This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Applets and the fly likes Menu Choice() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Applets
Bookmark "Menu Choice()" Watch "Menu Choice()" New topic

Menu Choice()

Mark Miranda

Joined: Feb 25, 2011
Posts: 24

I'm new to Java and making Applets and right now I have a choice() menu drop down menu that i'm using.

How can I make it so that when I choose Cat from the drop down, it displays a picture of a Cat? or if I choose do, it shows a picture of a Dog?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
Instead of menu.addItem("Cat") you would use something like this:

If you have lots of menu items then there are ways to make the code more compact, but this approach should get you going.
Mark Miranda

Joined: Feb 25, 2011
Posts: 24
thank you for the help!
Have you checked out Aspose?
subject: Menu Choice()
It's not a secret anymore!