Two Laptop Bag*
The moose likes Beginning Java and the fly likes Buttons on Java... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Buttons on Java..." Watch "Buttons on Java..." New topic
Author

Buttons on Java...

Rose Evans
Ranch Hand

Joined: Oct 14, 2004
Posts: 195
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

Joined: Jun 09, 2003
Posts: 4632
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

Joined: Oct 14, 2004
Posts: 195
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

Joined: Jul 11, 2001
Posts: 14112
Moving to Swing/AWT...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Buttons on Java...
 
Similar Threads
adding a picture
How can I get the GridLayout to work in this program
Error messages
adding a picture
Buttons on Java...