Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Buttons on Java...

 
Rose Evans
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You guys..I'm stuck again....My Lays button and my popcorn button do not work when I click on them....it looks like I made them the same way..so what's wrong???

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
text mis-match
JButton ChipsButton = new JButton("Lays Chips");
else if (e.getActionCommand( ).equals("Lay Chips"))

missing
else if (e.getActionCommand( ).equals("Popcorn"))
 
Rose Evans
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Layne,,,thank you, thank you, thank you!! That was a duh on my part!! Ha ha...
Now would you know how to add a text field...in dummy terms for me???
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic