2,777 Posted Topics

Member Avatar for ranu jain

Since that class's add method takes one argument, you will have to merge all the objects you want to save in the list into a single class that you can put into the list. In your design, how will you find and retrieve the value for a key passed to …

Member Avatar for JeffGrigg
0
183
Member Avatar for ba.accounts

Cross posted at [url]http://www.javaprogrammingforums.com/collections-generics/10306-java-uneven-2d-array.html#post39134[/url]

Member Avatar for ba.accounts
0
2K
Member Avatar for ZER09

Are you asking how to define global constants in one class that can be used in other classes? Define a class with variables: class TheGlobals { final static public <type> <name> = .... } To use a variable: TheGlobals.<name>

Member Avatar for ZER09
0
189
Member Avatar for sirlink99

[QUOTE]and neither of them worked.[/QUOTE] Those techniques for reading image files expect the image files to be on a disk. If you want to read the image "files" that are in a jar file, you must treat them as resources and use the getResource() or getResourceAsStream() methods to get a …

Member Avatar for sirlink99
0
1K
Member Avatar for sirlink99
Member Avatar for NormR1
0
319
Member Avatar for harinath_2007

What happens if you add a long counter and execute the code and print out the value of the counter?

Member Avatar for harinath_2007
-1
229
Member Avatar for ranu jain
Member Avatar for NormR1
0
138
Member Avatar for Majestics

[QUOTE]way that we can update the class file at runtime rather then whole jar file. I want to provide update facility to user.[/QUOTE] Are you looking for a utility to replace a class file that is in a jar file with another version of that class file? I haven't seen …

Member Avatar for NormR1
0
114
Member Avatar for corby

No idea what your code is supposed to do. Can you explain your problem in terms of x and y values? You have a character at one x,y location and an object at another x,y location. Then what do you want to happen? How are the x,y values changing for …

Member Avatar for NormR1
0
193
Member Avatar for justyno

Also the JTextpane supports marking up sections of the displayed text.

Member Avatar for NormR1
0
86
Member Avatar for sirlink99

Try moving the code around and trying different combinations. I did this and that and the other and got it to work. For example add lbl directly to the frame without the scrollpane and see what happens.

Member Avatar for mKorbel
0
197
Member Avatar for ians_acess

Did you try placing \n in the String where you want the new line to start?

Member Avatar for NormR1
0
180
Member Avatar for hamiltino

Do you have a question about your code? Please explain what you have tried and what problems you are having. See the answers on your other post at [url]http://www.java-forums.org/new-java/47262-creating-polynomial-using-linked-lists.html[/url]

Member Avatar for JeffGrigg
0
208
Member Avatar for Genericusername

When you get errors, it helps if you copy and paste here the FULL text of the error message.

Member Avatar for Zetlin
0
246
Member Avatar for J-Dub

Minor points: Class name should start with Uppercase Indenting of code in methods and loops not consistent A method and variable with the same name: Wincheck with different case Creating a new object on every method call vs once outside the method Font X = new Font("X",Font.PLAIN, 150); Undocumented usage …

Member Avatar for peter_budo
0
437
Member Avatar for pseudorandom21

To execute a java program on your PC you need to install the Java Runtime Environment(JRE). Go to the Oracle site and find the download for a current version of the jre. I don't understand what you mean by "from my personal website". That implies an HTML file with an …

Member Avatar for NormR1
0
125
Member Avatar for Srin

[QUOTE] The problem is. on the next click/drag, the old line disappears when the paint method is called again[/QUOTE] You need to save old lines in a list that the paint method can access and use to draw the old lines as well as the current line. There is no …

Member Avatar for Srin
0
1K
Member Avatar for jovialbimmer

[QUOTE] continuously loops then it stops[/QUOTE] What values of what variables will allow the program to continuously loop? Try debugging your code by Adding some printlns inside of the loop to display the value of the variable that controls the loop's execution.

Member Avatar for JeffGrigg
0
145
Member Avatar for rotten69

Is that the full text of the error message? The stack trace doesn't show what line in your program the error occurred on. What lines of source in your program causes this error?

Member Avatar for NormR1
0
249
Member Avatar for andersonelnino

[QUOTE] dont know why is not working[/QUOTE] Please explain. If there is output, please copy and paste it here and explain what is wrong with it and show an example of what it should be.

Member Avatar for NormR1
0
215
Member Avatar for J-Dub

[QUOTE]how I can set up a action listener for an array of buttons[/QUOTE] Are you going to create a new listener for each button or use the same listener for all the buttons? The syntax is: <A reference to a button>.addActionListener(<A ref to the listener>); The <A reference to a …

Member Avatar for mKorbel
0
4K
Member Avatar for akasekaihime

You should read the Tutorial about how applets work. Go to this site and Find Applet [url]http://download.oracle.com/javase/tutorial/reallybigindex.html[/url]

Member Avatar for akasekaihime
0
321
Member Avatar for DarkPheonix

Look at your code. What conditions will cause the menu to be printed twice? Add a println to show what the user entered and was read into the a variable. Run your program and copy the console and paste it here so we can see what you entered and what …

Member Avatar for FireBlah
0
322
Member Avatar for javinpaul

Not sure you can change it once the JVM has started. Try it and see what happens. You may need to build your own classloader that uses the paths you want it to use.

Member Avatar for JeffGrigg
0
231
Member Avatar for VIPERHlr

Is this the same as posted here: [url]http://forums.devshed.com/java-help-9/urgent-help-needed-839011.html#post2675742[/url]

Member Avatar for peter_budo
0
137
Member Avatar for ericfrank

I'm not sure why your IDE complains. What is the full text of the error message if you compile the program with javac? Try making very small test programs and see what happens.

Member Avatar for NormR1
0
197
Member Avatar for muthu1802
Member Avatar for Aviras

Add some printlns to show when the different events occur. When does the getImage() method have the full image?

Member Avatar for Aviras
0
423
Member Avatar for Pravinrasal

[QUOTE]i want to run demo.java from this code[/QUOTE] Normally files with the .java extension contain text that is a source for a java program. You "run" the .class file that is created by the javac compiler. If you want to "run"/execute the .class file you could call its main method …

Member Avatar for NormR1
0
347
Member Avatar for sathya88

@#Muralidharan.E I can't tell from the comments in your code what parameter is being passed to the Thread. Could you edit your example and explain that?

Member Avatar for Muralidharan.E
0
15K
Member Avatar for pro_learner

What are your ideas for showing the moving of elements in the list as they are being sorted?

Member Avatar for pro_learner
0
167
Member Avatar for sathya88

Look at the reflection package: java.lang.reflect It has classes and methods for getting at the contents of a class.

Member Avatar for sathya88
0
216
Member Avatar for mike101290

What data you need from the user and what do you want to display to the user? Can those things be done with some text fields and buttons? Get rid of the Scanner and replace it with the above. Do you have any specific questions?

Member Avatar for NormR1
0
459
Member Avatar for vishal1949

[QUOTE] it didnt go to well.[/QUOTE] Can you copy and paste the programs output here and add some comments about what is wrong.

Member Avatar for Muralidharan.E
1
591
Member Avatar for carloskire

[QUOTE]is not executed and apparently stops execution.[/QUOTE] [CODE] [COLOR="Red"]//[/COLOR] e.printStackTrace();[/CODE] Remove the // so you can see the error message printed.

Member Avatar for carloskire
0
273
Member Avatar for rotten69

[QUOTE]Are we allowed to assign different values to just one variable?[/QUOTE] only arrays can contain more than one value. equals is a method that the writer of a class can define what the method is supposed to do. For Strings it compares the contents of the two String objects. == …

Member Avatar for NormR1
0
195
Member Avatar for jpleas

Do the assignment one small step at a time. Compile frequently. Add the few statements to your code that will properly define a simple class and compile it. Add a no argument constructor and the ending } When that works. move on to the next item in the assignment. Take …

Member Avatar for NormR1
0
140
Member Avatar for Pravinrasal
Member Avatar for rotten69

Add a print statement just before the if statement to print out the values of BOYS and GIRLS. Perhaps the printout will show you the problem. Copy the console when you execute the program and paste it here that shows the problem. To copy the contents of the command prompt …

Member Avatar for NormR1
0
193
Member Avatar for andersonelnino

If you will research each of these points and post your results, we'll be glad to give our opinions on your answers.

Member Avatar for JeffGrigg
-1
311
Member Avatar for shan123456

Cross posted at [url]http://www.java-forums.org/java-applets/47149-counting-words-java-applet.html#post226238[/url]

Member Avatar for sirlink99
0
184
Member Avatar for andersonelnino
Member Avatar for sirlink99

Another choice for reading an image file is the ImageIO class. It has several methods to do that.

Member Avatar for NormR1
0
73
Member Avatar for jackmaverick1

[QUOTE]what it does read is [C@1d6096. [/QUOTE] Not sure what you mean by "read" The string: [C@1d6096 looks like the output from a print. The [C@1d6096 is the String returned by the Object class's toString method for an array([) of chars(C) at memory location 1d6096. Look at the String class …

Member Avatar for sirlink99
0
326
Member Avatar for hatebin

[CODE] Object de=new Decoding(new FileInputStream("TestXML2.xml")); JButton button1=(JButton) de; [/CODE] To do that you need the Decoding class extend the JButton class. Then I'm not sure how it would work. Constructors "return" an instance of their class. Not another class If you want another data type returned, then use a method.

Member Avatar for hatebin
0
116
Member Avatar for dcparham
Member Avatar for jackmaverick1
0
173
Member Avatar for 47pirates

[QUOTE]i just want to add one panel into another[/QUOTE] You use the add() method to add a component to a container. A panel is both a component and a container so one can be added to another. [QUOTE]through actionlistener of some button..[/QUOTE] Doing this could change the GUI layout. You …

Member Avatar for 47pirates
0
410
Member Avatar for JavaStudent101z

One thing your posted code does not do is ask the user to enter his choice. Once in the while loop, if the value of choice is not changed, you will never exit the loop. In future, please wrap your code in code tags

Member Avatar for NormR1
0
135
Member Avatar for smiles5611

Please edit your code and add code tags (the [code] icon above the input box) to restore the code's indentations. Unformatted code is hard to read.

Member Avatar for NormR1
0
250
Member Avatar for JavaStudent101z

Please edit your code and wrap it in code tags. Use the [code] icon above the input box. What is your problem with the code? What does it do? What do you want it to do? If you get errors, please copy and paste here the full text of the …

Member Avatar for NormR1
0
207

The End.