2,777 Posted Topics
Re: 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 … | |
Re: Cross posted at [url]http://www.javaprogrammingforums.com/collections-generics/10306-java-uneven-2d-array.html#post39134[/url] | |
Re: 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> | |
Re: [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 … | |
Re: Get this into a String and print it out: fileDestination.getText() | |
Re: What happens if you add a long counter and execute the code and print out the value of the counter? | |
Re: Please copy and paste here the full text of the error message. | |
Re: [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 … | |
Re: 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 … | |
Re: Also the JTextpane supports marking up sections of the displayed text. | |
Re: 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. | |
Re: Did you try placing \n in the String where you want the new line to start? | |
Re: 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] | |
Re: When you get errors, it helps if you copy and paste here the FULL text of the error message. | |
Re: 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 … | |
Re: 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 … | |
Re: [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 … | |
Re: [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. | |
Re: 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? | |
Re: [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. | |
Re: [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 … | |
Re: 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] | |
Re: 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 … | |
Re: 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. | |
Re: Is this the same as posted here: [url]http://forums.devshed.com/java-help-9/urgent-help-needed-839011.html#post2675742[/url] | |
Re: 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. | |
Re: Have you read about the Runtime and Process classes? | |
Re: Add some printlns to show when the different events occur. When does the getImage() method have the full image? | |
Re: [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 … | |
Re: @#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? | |
Re: What are your ideas for showing the moving of elements in the list as they are being sorted? | |
Re: Look at the reflection package: java.lang.reflect It has classes and methods for getting at the contents of a class. | |
Re: 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? | |
Re: [QUOTE] it didnt go to well.[/QUOTE] Can you copy and paste the programs output here and add some comments about what is wrong. | |
Re: [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. | |
Re: [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. == … | |
Re: 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 … | |
| |
Re: 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 … | |
Re: If you will research each of these points and post your results, we'll be glad to give our opinions on your answers. | |
Re: Cross posted at [url]http://www.java-forums.org/java-applets/47149-counting-words-java-applet.html#post226238[/url] | |
Re: You forget to ask any questions about your problem. | |
Re: Another choice for reading an image file is the ImageIO class. It has several methods to do that. | |
Re: [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 … | |
Re: [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. | |
Re: [QUOTE] how do i *start over*[/QUOTE] usually that is done by putting the code in a loop. | |
Re: [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 … | |
Re: 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 | |
Re: 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. | |
Re: 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 … |
The End.