2,777 Posted Topics
Re: Can you explain your logic in pseudo code that solves the problem? If you have a bad design then you should fix that. If you have good logic, is your code following your logic? Add some println statements to the code to show what it is doing. If you understand … | |
Re: The details section has a good list for starting: basic socket programming, threading and GUI design using Javasnetwork library, threading system, and swing user interface libraries and more here: keep track of these handlers some sort of dynamic data structure such as a vector or similar data structure | |
Re: Your code is doing what you are asking it to do. If you want it to do something different, you need to change the code. What does the replace() method do? What do you expect it to do? Read the API doc for the replace() method to see how to … | |
Re: Do you get the line number where the error occurs so you can find the null variable and fix the problem? | |
Re: Can you post some output that shows what the code is doing and add some comments to the output to show what it should be. Add enough debugging printlns to the code to show how the variables are set and changed as the code executes. What is the insert method … | |
Re: Use a disk file. It could be written to and read from as needed. | |
Re: > Textfield doesn't seem to be aligned with the Message Label. You should look into how to use layout managers. Your code appears to be using the default layout manager for the JPanel class. The are several choices of layout managers. Some times you need to creat a new panel … | |
Re: Put the Ball objects into an arraylist and change the code that refers to the 2 individual Ball objects to use a loop to get the objects one at a time from the arraylist. | |
Re: What component is there that uses the background color? | |
Re: You can store data in a class variable. After you have read in the user's input and verified that it is good, store it into a class variable to make it available to other methods in the class. To pass the data to another class's method, you can call that … | |
Re: Is this the same problem? [Link Anchor Text](http://www.java-forums.org/java-applets/57603-moving-ball-dragging-mouse.html | |
Re: What you are doing is changing the contents of the Student object and adding the same object reference to the arraylist so you end up with the arraylist containing references to the one and only Student class object whose contents are set to the last values. Make a new Student … | |
Re: Pass a reference to the array in a method call or have a method that returns a reference to the array | |
Re: Can you make a small, simple program that compiles, executes and shows the problem? | |
Re: The terminal/console is not very programmable. It may be time to look at using GUI. | |
Re: Do you have any specific java coding questions? Your questions seem to be looking for someone to write code for you instead of asking how to do something in java. | |
Re: Post the full text of the error message. You have left off the important part. | |
Re: > Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at application.applicationView.actionPerformed(applicationView.java:825) There is a variable on line 825 with a null value. Look at that line and find the variable with the null value. Then backtrack in the code to find out why that variable does not have a valid non null value. | |
![]() | Re: > Thread is stuck somewhere? To find where the code is executing, add lots of println statements to your code that will record where the program is executing. The print out will show you what the code is doing. ![]() |
Re: > I couldn't compile the BookTest.java. Please post the full text of the error messages. | |
Re: Start by reading the file line by line. Why do you want it in a 2D array? What goes into the two dimensions? | |
Re: Put the images into JButtons as an icon and click on the button to select it. | |
![]() | Re: What happens when you execute the code? Do you get the results you want? If not, please explain. ![]() |
Re: look at the letters in the words and remember which are the same. | |
Re: At line 40 there is an index to an array that is past the end of the array. The index has a value of 16. Look at line 40 and see how large the array is and what controls the value of the index is that is being used there. … | |
Re: Is the paint() being called when you expect it to be called? Are the images being loaded properly so they can be drawn? | |
Re: > class com.scand.jtree.TreeApplet.class not found. Where is the class definition for the class: com.scand.jtree.TreeApplet.class class? The name of the class looks like a filename NOT a class name. A class name would not end with .class. Where are you specifing the class name? Remove the .class from the end of … | |
Re: What statement does the exception occur on? what is the value of the index when it occurs? The code needs to test array indexes and not use any that are past the end of the array. Remember array indexes are zero based: 0 to the length-1 | |
Re: To see the results of your code, add a println statement that prints out the value of the variable after its value is changed. The printout will show you what the code is doing. Your code does not change the value of something. | |
Re: > whether the weather attributes are consistant or not. Can you define what the correct values are? What should the code do if the values are wrong? | |
Re: How do you get access to each term in a polynomial? Can you access only the first term in poly2 and use that with poly1. | |
Re: You pass values between classes and methods by getting a reference to the class with the method you want to call and calling a method in that class. TheClass aRef = <get a reference to the classs somehow> aRef.someMethod(<The value to pass>); // call the method in the class and … | |
Re: > java.lang.NoSuchMethodError: main You need to provide the standard main() method in the class that you try to execute with the java command. | |
Re: > ava.net.MalformedURLException: unknown protocol: c It looks like you are using a URL with an invalid protocol. Some valid protocols: http: ftp: file: The c is probably from a path: c:/path/.... Add a valid protocol to the URL you are using. > class com.scand.jtree.TreeApplet.class not found. Where is the class … | |
Re: I think you will need some kind of driver that will connect to java to get data from a serial port. | |
Re: > use get methods.It seems like the value I get is 0 What method are you calling that is returning a 0? | |
![]() | Re: Its tricky to get the buttons to be drawn after you draw the image. One thing you should override the paintComponent method for swing classes. |
Re: > listen for tab being pressed? Print out the event passed to the listener and see what is passed to it when tab is pressed. | |
Re: > convert the selected item into words in the text area. Can you give an example? | |
Re: Use the String class methods to get the parts of the input String. Use the Integer class method to convert a String part to an int. When the parts are separated they can be put into the places where you want them to go. | |
How do you wrap code in tags. This OP had a problem doing it: See http://www.daniweb.com/software-development/java/threads/418944/choice-and-text-area-convert-number-to-word `String var = null; forIint i etc // end` | |
Re: > i am not able to invoke line 41 owner.pets[ 3 ].getAction();? Do you get compiler errors? If so please post them. Otherwise explain what the problem is. Note: the getAction() method returns a String that your code ignores. | |
![]() | Re: Are there any third party packages that parse RDF files? It looks like XML. Does it have the same syntax rules? If so there are packages for parsing XML files. |
![]() | Re: > I am having troubles updating the interface Please explain what your problem is. |
Re: This new forum formatting of posts is awful. The code you posted is very confusing with the way it comes and goes out of formatting. Where was the ^ in the original error message? You should not need a this. in the println() statement. | |
Re: You should use the equals() method to compare Strings. The == operator mostly is for primitives. |
The End.