Michael Dunn wrote:at the moment you're using a bunch of System.out.println's to print:
Total number of excuses: 264
The Excuse Water spilled on it had the max numer of excuses
The Excuse A tornado got it had the min numer of excuses
Excuse name # of excuses
My dog ate it 15
It burned 12
I lost it 18
I ate it 23
It fell down the sewer 16
It shredded 44
I forgot it 19
I can't remember 17
Water spilled on it 0
A tornado got it 1
continue with the current program, but try to print all of the above in a single println,
which would mean using a StringBuffer, or StringBuilder to create a single String of the above
so it would be
String message = [will end up as all of the above];
System.out.println(message);
now when it prints out exactly as above, you change
System.out.println(message);
to
javax.swing.JOptionPane.showMessageDialog(null,message);
Campbell Ritchie wrote:
What does that mean? It seems contradictory to me.mike statham wrote:I need to read from a file that is set up like called (filename.txt)
. . .
but I have to do it from a pane because I cannot figure out how do it easier without having to type it in from a window. . . .
If you are reading from a file, you ought not to do it in the main method. Your main method contains 49 lines. That is 48 too many. You ought to have a method which reads from the file. Then you can create an object of a class which encapsulates the pay, tax allowance, parking tickets, etc. You are inappropriately using the static keyword for things which ought not to be static in your example.