• Post Reply Bookmark Topic Watch Topic
  • New Topic

trying to make a simple GUI to find the average of four test scores.  RSS feed

 
Thomas Beaulieu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
New to the forum. I've been struggling with the GUI, I've got it close but I keep getting an error. (and it's late and I'm very tired lol) Can anyone tell me what I'm doing wrong? I'll post the error as a comment.

 
Thomas Beaulieu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
testscores.java:102: error: unexpected type
averageTF.setText (""=twoDigits.format(ave));
^
required: variable
found: value
1 error
 
Carey Brown
Saloon Keeper
Posts: 2538
33
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thomas Beaulieu wrote:testscores.java:102: error: unexpected type
averageTF.setText (""=twoDigits.format(ave));
^
required: variable
found: value
1 error

I think you meant to use == and not =. However using == to compare Strings is incorrect, you should use equals() instead.
"".equals(twoDigits.format(ave))
 
Fred Kleinschmidt
Bartender
Posts: 509
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I think he meant to use was

but why not just

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!