[My Blog]
All roads lead to JavaRanch
You convert your getData method from Program 1 to the inputScores method. However, it is not needed in this program as the data is read in via the GUI. The method setScores would look like:
The only change in calculateScore is that it doesn't return the actual score but assigns to it to the member of result. The user gets the value of result by calling the method of getResult, which just has one line of code.
[My Blog]
All roads lead to JavaRanch
[My Blog]
All roads lead to JavaRanch
[My Blog]
All roads lead to JavaRanch
andrew cassato wrote:when i try to have the JLabel display the result like so:
it tells me "cannot find symbol - constructor JLabel(double)" so how do you have it display a variable?
my brain is fried
Life is easy because we write the source code.....
actionPerformed :
If all of the scores are within range, it will put the array of scores in Judging by calling setScores. It will then call the method calculateScores of Judging to compute the score. It will then call the method of judging getScores to get the score. It will put the attained score into the textbox for the score.
it tells me "cannot find symbol - constructor JLabel(double)" so how do you have it display a variable?
[My Blog]
All roads lead to JavaRanch
grapes are vegan food pellets. Eat this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|