32,199 Topics

Member Avatar for
Member Avatar for mohamed mo'men
Member Avatar for NormR1
0
56
Member Avatar for Monkeyseraph

[CODE] public boolean randomFlower() { Grid<Actor> gr = getGrid(); ArrayList<Location> loc = new ArrayList<Location>(); loc = gr.getOccupiedLocations(); int row = (int)(Math.random() * 19); int col = (int)(Math.random() * 19); Location new1 = new Location(row, col); boolean existent = false; // if i is less than size of occupied locations for …

Member Avatar for NormR1
0
90
Member Avatar for insanely_sane

Hey guys. I am currently just a 11th grade student but since I'm done the whole curriculum for my Computers class already, I recently just started making extra stuff for fun. One of things I'm doing is Making a graphical/visual sorting applet. Something like : [url]http://www.cs.ubc.ca/~harrison/Java/sorting-demo.html[/url] I have my code …

0
109
Member Avatar for mayank.15

I am using Lucene Highlighter 2.4.1 for my application. I use the highlighter to get the best matching fragments, and display them. I make a call to a function String[] getFragmentsWithHighlightedTerms(Analyzer analyzer, Query query, String fieldName, String fieldContents, int fragmentsNumber, int fragmentSize). For example : [code=java] String text = doc.get("MetaData"); …

Member Avatar for ~s.o.s~
0
164
Member Avatar for gedas

hi guys, i am planning to undertake a massive project which would be something to do with wii remote as i am aware the wii remote communicate with the console or computer via blue-tooth. i was wondering what sort of data wii remote sends back to the computer or a …

Member Avatar for gedas
0
106
Member Avatar for nchouhan

Hi, i am new to java, and i stuck in between with a folder locking problem. i want to create a private folder without encrypting the data, i have two options 1) Either Lock that folder so none of the user (even admin) can't access that private data. 2)Completely hide …

Member Avatar for nchouhan
0
158
Member Avatar for Naveed_Cn

Hi Every Body! Please any body tell me, is java is so powerful to do system programming wih it like C language and Assmbly.

Member Avatar for vishalbaid
0
2K
Member Avatar for end3r

Hy, I have 4 combo-boxes and each one has a RefreshableValueHolder. If I change the value in one of them, I would like to automatically change contents of the others. I know I have to use the refresh() method of this class, but I cannot figure it out how. for …

Member Avatar for end3r
0
96
Member Avatar for rmsagar

Hi Everyone, I am a beginner with java, please pardon my stupidity The program below is not working and I have this error. Please let me know what I am doing wrong. public class test { public static void main(String[] args) throws Exception { String Month = "May"; if ( …

Member Avatar for rmsagar
0
90
Member Avatar for maxish

Hi, I have implemented a simple socket server in Java. Everything works great except the process just dies/times out after about an hour and I do not know why. I run am running the process through my web host's machine using SSH. My steps: 1. Add to '/etc/rc.local' two commands: …

Member Avatar for masijade
0
417
Member Avatar for Umar Ali

Hello I'm new to java and i'm facing some problem... First code refers to File_Chooser class which works perfectly fine for me... [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package statguis; /** * * @author Umar Ali */ …

Member Avatar for Umar Ali
0
797
Member Avatar for kdmuk10

I am new to java. when i try some code, i get the 'Caught ArrayIndexOutOfBoundsException: 0' message. i need help how to address the problem. the code was as follows. I am leaving out the class name (first line) [CODE]public static void main(String[] args){ try { double hours = Double.valueOf(args[0]).doubleValue(); …

Member Avatar for Ezzaral
0
64
Member Avatar for johndoe444

[CODE] public class FirstJndi { public static void main(String[] args) { String name = args[0]; Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); try { // Create the initial context Context ctx = new InitialContext(env); // Look up an object Object obj = ctx.lookup(name); System.out.println(name + " is bound to: " …

0
30
Member Avatar for gokul.raja

Hello, I'm having a requirement to develop a GUI based JFrame which should have capabilities to add Multiple JPanel on an event occurrence[Ex. button click] and the JFrame should be scrollable. I tried a lot, but I failed. I also tried to add multiple Jpanel in JScrollpane that also failed. …

Member Avatar for gokul.raja
0
2K
Member Avatar for softdev

hi guys, i have this senario and i want know if that is possible. i want to apply some aspect-oriented concept. i want to have something like, say two classes. one extract some piece of data from xml file and use JSP to display the data. another class/aspect that log …

Member Avatar for ~s.o.s~
0
79
Member Avatar for jcorcoran

I have a school assignment where I have to write class files to correspond with my instructor's already written class, which includes the main() method. He has the main class importing the child class of a ParentClass, each of which is in a different package. In the main method, he …

Member Avatar for ~s.o.s~
0
80
Member Avatar for bsunkel

Hi all, I have a JOptionPane with a YES button and a NO button. All I want to do is be able to press the left or right button on the keyboard to change the focus on the buttons. By using the mouse it works. Is there some kind of …

Member Avatar for viniciusmss
0
641
Member Avatar for idlackage

I have a method that takes in a rectangle shape as a parameter, uses it as a selection box, and finds shapes in an array called shapeObjects that are within the bounds of the selection box. The indexes of those shapes are then added into a new array which is …

Member Avatar for javaAddict
0
94
Member Avatar for arash_khazaei

Hi, I am currently working on curling game for my High School assignment and i have lots of files of code, so i doubt anyone will want to look through them. Im having an issue in which, i have a JPanel and when i call the paintComponent (Graphics g) of …

Member Avatar for masijade
0
108
Member Avatar for Felikim

Hi guys; Am stuck on the following piece of code which is meant to delete obsolete files in a directory in an sms server. It runs well from a windows platform on which it was coded in, but can not run from a linux platforrm correctly. On the linux lastmodified …

Member Avatar for tmanohar
0
329
Member Avatar for ngoelnoi

I am using a Multi column JTextPane. Everything is working fine but I also want to add some space after each column in JtextPane to improve the readability of the text in the Jtextpane. In my current project, it is unable to differenciate between text of two columns. I am …

Member Avatar for ngoelnoi
0
152
Member Avatar for mohamed mo'men

[code]package taskvip; import java.util.Random; public class Main { public static void main(String[] args) { int y =0; Random t =new Random (); fun1 e = new fun1(); for ( e.i = t.nextInt(50); e.i < 100; e.i++) { e.A[e.i]= e.k.nextInt(50); y=e.k.nextInt(); } for ( e.i = 0; e.i < 100; e.i++) …

Member Avatar for mohamed mo'men
0
407
Member Avatar for DrApe1

For my Programming class I have to write a program to get the Date and time from a Daytime protocol server. If you don't know, the format for the Daytime protocol is as follows: [code]JJJJJ YR-MO-DA HH:MM:SS TT L H msADV UTC(NIST) *[/code] YR being the last two digits of …

Member Avatar for aspire1
0
128
Member Avatar for rythreion

[code]import java.io.*; public class BaseTransform { private final BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in)); public BaseTransform(){ try{ System.out.print("Enter any integer: "); int input=Integer.parseInt(this.getInput()); System.out.print("Enter a base[2...16]: "); int base=Integer.parseInt(this.getInput()); String answer=this.transform(input,base); if(answer!=null){ System.out.println(""+input+" at base "+base+" is "+answer+"."); }else{ System.out.println("Error!"); } }catch(Exception e){ e.printStackTrace(); } } public static void main(String args[]){ BaseTransform …

Member Avatar for peter_budo
0
94
Member Avatar for zeah

Hi, I am building a searchengine which searches some html and text files in the web directory. I was trying to use lucene. I was able to index the file and query a word and get the documents which contains that search word. But the problem i was incurring is …

0
51
Member Avatar for mitch9654

This button will only appear if you move your mouse over it. See here: [url]http://mitch9654.zymichost.com/Java/index.html[/url] You hava to move the mouse around the top left my applet is this [code] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package …

Member Avatar for mitch9654
0
101
Member Avatar for DrApe1

I realize this is an extremely low level java problem, but I've been searching and searching and I can't figure out a way to take two characters and combine them into one string. Particularly, I have a char array and I need to take two particular elements out of it …

Member Avatar for DrApe1
0
120
Member Avatar for san_fran_crisko

Hi, I'm trying to get Java to remove a JLabel from a JPanel whenever a button is clicked. Unfortunately it won't do this. I've tested my code and the button click is working for sure, so its the code to remove the component that is acting up. If anyone could …

Member Avatar for peter_budo
0
4K
Member Avatar for Tyrone.Wilson

I want to develop a landscape design layout tool. it would be a CAD program of sorts but would need to look more aesthetic. at the end of it, it would need to look almost hand drawn. trouble is I am a bit of a noob having only developed a …

0
66
Member Avatar for mayank.15

Im trying to run my java application, but after some time it automatically stops and throws OutOfMemoryException: Java heap space. Now when i try to run it using (say) (-Xmx allocates the maximum heap memory) java -Xmx2000m [AppName] then it says Error occured during initialization of VM Could not reserve …

Member Avatar for mayank.15
0
176

The End.