2,777 Posted Topics

Member Avatar for c.pentasuglia

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.

Member Avatar for c.pentasuglia
0
245
Member Avatar for c.pentasuglia

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.

Member Avatar for c.pentasuglia
0
298
Member Avatar for shean1488
Member Avatar for shean1488
0
333
Member Avatar for jarograv

There is missing code before line 13. I'd expect to see a class definition and a method there.

Member Avatar for jarograv
0
885
Member Avatar for polarbear125

> '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 …

Member Avatar for DavidKroukamp
0
204
Member Avatar for shaswat.j

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 …

Member Avatar for NormR1
0
87
Member Avatar for NoUserNameHere
Member Avatar for NormR1
0
308
Member Avatar for Kert

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.

Member Avatar for Kert
0
158
Member Avatar for joankim

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

Member Avatar for NormR1
0
2K
Member Avatar for bam010893

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 …

Member Avatar for NormR1
0
203
Member Avatar for dhija22

[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.

Member Avatar for ash.28.88
0
126
Member Avatar for sadzee
Member Avatar for ash.28.88
0
195
Member Avatar for Samama

First thing to do would be to analyze the program's requirements and create a design for the program.

Member Avatar for stultuske
0
114
Member Avatar for c.pentasuglia
Member Avatar for tleverington1

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

Member Avatar for tleverington1
0
161
Member Avatar for Kert
Member Avatar for Kert
0
187
Member Avatar for memz

Please explain what happens when the code is executed, post the console output and explain what you want the code to do.

Member Avatar for memz
-1
308
Member Avatar for blake81

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?

Member Avatar for NormR1
0
175
Member Avatar for Tuz

How are you executing the compiler? What is the classpath when you execute the javac command. Where are the source files?

Member Avatar for NormR1
0
92
Member Avatar for mags11

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 …

Member Avatar for stultuske
0
1K
Member Avatar for justindill

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?

Member Avatar for justindill
0
3K
Member Avatar for 3nrichedd
Member Avatar for NormR1
0
229
Member Avatar for Zilna

> 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 …

Member Avatar for NormR1
0
199
Member Avatar for Bladtman242
Member Avatar for Bladtman242
0
187
Member Avatar for pedojacko

> 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 …

Member Avatar for NormR1
0
139
Member Avatar for raj.mscking

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.

Member Avatar for NormR1
0
349
Member Avatar for Majestics

What source line caused it? And what is the definition for the constructor in the ProductEntries class.

Member Avatar for Majestics
0
137
Member Avatar for rangach98

Are you looking to hire a programmer for this? This is not the place for that.

Member Avatar for NormR1
-1
53
Member Avatar for coroll

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.

Member Avatar for coroll
0
5K
Member Avatar for rob211
Member Avatar for rob211
0
138
Member Avatar for Gazzmonkey

Are the results correct? If not please explain what is wrong and what the print out should have been.

Member Avatar for Gazzmonkey
0
240
Member Avatar for OldDeveloper01

The Random class has a nextInt() method you could use to generate an index into the array.

Member Avatar for m4ster_r0shi
0
246
Member Avatar for VengefulToast

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.

Member Avatar for NormR1
0
246
Member Avatar for rlord3534

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.

Member Avatar for NormR1
0
207
Member Avatar for nicolemarie

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?

Member Avatar for stultuske
0
788
Member Avatar for VengefulToast

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.

Member Avatar for VengefulToast
0
283
Member Avatar for jamie6441

> scanner can do to SKIP over the first line of the txt file Read the first line and ignore it.

Member Avatar for jamie6441
0
3K
Member Avatar for Stjerne

If you want multiple lines, look at using a text area instead of a text field.

Member Avatar for JamesCherrill
0
115
Member Avatar for c.pentasuglia

Have you tried the JFileChooser in output/save mode? It might do that. Or the JOptionPane class could be used.

Member Avatar for c.pentasuglia
0
107
Member Avatar for c.pentasuglia

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?

Member Avatar for c.pentasuglia
0
182
Member Avatar for VengefulToast

Read the contents of the file into a String array and use that array in the JList's constructor

Member Avatar for NormR1
0
136
Member Avatar for Hitman Mania

Is the code so far working the way you want? Do you have any specific questions about it?

Member Avatar for NormR1
0
278
Member Avatar for nicolemarie

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?

Member Avatar for NormR1
0
243
Member Avatar for msmriyas

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 …

Member Avatar for NormR1
0
158
Member Avatar for c.pentasuglia
Member Avatar for msmriyas

Please post the full text of the compiler's error message that shows the source line and the error message.

Member Avatar for NormR1
0
215
Member Avatar for NoUserNameHere

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()

Member Avatar for NoUserNameHere
0
147
Member Avatar for prnjn

> 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 …

Member Avatar for NormR1
0
401
Member Avatar for migelitto

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.

Member Avatar for NormR1
0
203
Member Avatar for DaAznSmurf

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.

Member Avatar for NormR1
0
1K

The End.