2,777 Posted Topics
Re: You will have to control when the program uses the System.exit() method. Don't use it until you want the the program execution to end. You could add listeners to the window you want to leave displayed that would call System.exit() when the window is closed. | |
Re: That code will call the main() method of the MainClass class. If you want to call some methods in a class that is in the jar file, you need to create an instance of the class and use its reference variable to call its methods. | |
Re: Can you explain what you mean by > how much memory was used What are you looking for? | |
Re: There is missing code before line 13. I'd expect to see a class definition and a method there. | |
Re: > 'variable result might not have been initialized Give it a value when you define it on line 20 and the compiler will be happy. You should NOT have two variables with the same name: result. Rename one of them so they have different names. Using the same name will … | |
Re: Does your jar file have a correct manifest file with a Main-Class: entry? You will need that to execute a jar file with the java -jar option. What error message do you get if you open a command prompt, change to the folder with the jar file and enter: java … | |
Re: Does the applet have the focus so that is can get mouse events? | |
Re: You'd use a mouse listener. When you click on a component with a mouse listener the listener method would be called the same as the action listener. | |
![]() | Re: Have you tested the code? If you change the value of first what happens to the computation? second is a poor name for the variable with the power value |
Re: Where does the StdIn class come from? I don't recognize it as a Java SE class. What JDK are you using to compile the program? Your program only puts one String in the array and then sorts it. You need redesign your program to create an array outside of the … | |
Re: [QUOTE],what does mean a=b, si=s2[/QUOTE] The value of the variable to the right of the = is copied to the variable to the left of the =. Now both variables have the same value. | |
Re: >code is giving error Please post the full text of the error message. | |
Re: First thing to do would be to analyze the program's requirements and create a design for the program. | |
Re: Could the file be put in the jar file? | |
Re: You need to use a classpath with the jar file containing the missing class. java -cp .;mysql-connector-java-5.1.19-bin.jar SQL | |
Re: The Frame class has a method you can use to prevent the window being resized. | |
Re: Please explain what happens when the code is executed, post the console output and explain what you want the code to do. | |
Re: The compiler is complaining because it can not find the methods you are trying to use with a Scanner object in the Scanner class. Did you mean to define myScores as some other class object instead of as a Scanner? Perhaps as a Score? | |
Re: How are you executing the compiler? What is the classpath when you execute the javac command. Where are the source files? | |
Re: Where are the definitions for the variables refered to by the error message: cannot not find symbol The compiler can not find definitions for them that are in scope where they are used. Line 25: ` EmployeeID = ID;` Assigning a vlalue to an argument passed to a method is … | |
Re: Where are the values that you want to add to the showMessageDialog() call? Where will the user input them to the program so you can get the values and build the message to be displayed? Do you define varables that will have the values? | |
Re: Do you have any questions or problems with the posted code? Please explain. | |
Re: > for some reason my image will not show up. Is your only problem with the image? If that is the only problem, you have posted TOO MUCH code. Make a small simple testing program to work on the image loading problem. Something that will compile, execute and show the … | |
Re: Can you make a small complete program that compiles, executes and shows the problem? | |
Re: > how do i store it and called up them? What is the "it" you are talking about? If its a variable, please give us the name of the variable. What does "called up" mean? Where in your code are you having the problem. Can you name the methods and … | |
Re: The jar file with the class listed in the error message must be on the classpath when the program is executed. Please describe how you are executing your program, where the jar file with the missing class file is and what the contents of your jar file's manifest file. | |
Re: What source line caused it? And what is the definition for the constructor in the ProductEntries class. | |
Re: Are you looking to hire a programmer for this? This is not the place for that. | |
Re: Would the System class's currentTimemillis method help? I don't know how to ask the OS how much CPU time a program has used. | |
Re: How much rotation do you see with the posted code? I can't see any. | |
Re: Are the results correct? If not please explain what is wrong and what the print out should have been. | |
![]() | Re: The Random class has a nextInt() method you could use to generate an index into the array. |
Re: The StringTokenizer class is the old way of getting tokens from a String. The new way is the String class's split() method. However using split() requires you to use regular expressions which can take a while to master. | |
Re: What variable has the null value? why doesn't the variable have a valid value? Post the full text of the error message. It shows the line number where the error occurred. | |
Re: The compiler is complaining because it can not find a method named: makeP3Picture() with no arguments. The compiler does find a method that takes a Picture object. Do you have a Picture object that you can use when you call that method? | |
Re: To see where the computer is looking for the file, print out the File class's absolute path on about line 105. The print out will show you where the computer is looking for the file. | |
Re: > scanner can do to SKIP over the first line of the txt file Read the first line and ignore it. | |
Re: If you want multiple lines, look at using a text area instead of a text field. | |
Re: Have you tried the JFileChooser in output/save mode? It might do that. Or the JOptionPane class could be used. | |
Re: Is it the server that blindly writes the file? Can you get a list of files on the server so you know what files exist? | |
Re: Read the contents of the file into a String array and use that array in the JList's constructor | |
Re: Is the code so far working the way you want? Do you have any specific questions about it? | |
Re: Add an if statement before the **return a;** statement so it the compiler thinks there is a possibility that the code following the return could be executed. Why do you have code following the **return a;** statement? | |
Re: What program is giving you the error? javac or java > error:main method not found in class queue,please define Where is the code for the queue class shown in the error message. You have posted code for the Queue class. Java is case sensitive so q is not the same … | |
Re: I think there are methods in the class to do that. | |
Re: Please post the full text of the compiler's error message that shows the source line and the error message. | |
Re: Is the paint() method called? Add a println to see. What color is the shape that is drawn? Try calling setColor() Also try calling repaint() | |
Re: > Exception in thread "main" java.lang.NullPointerEXception > at javax.swing.ImageIcon.<init><unknown Source> > at hrms_project.Login_frame.<init><Login_frame.java:116> How are you using the ImageIcon class on line 116? It looks like the program may not be finding the file. Are you using the getResource method to find and read the file? Is the file supposed … | |
Re: The code in setData() looks like it will change the contents of the pilns array. If the change is not seen somewhere else in the program, it could be because that other location in the code has a copy of the array taken before the change was made. | |
Re: You are trying to pop from an empty stack at line 152. You need to debug the code to see why the stack is empty there. |
The End.