Win a copy of Kotlin in Action this week in the Kotlin forum!
  • 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
Bartender
Posts: 2992
46
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: 560
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I think he meant to use was

but why not just

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!