aspose file tools*
The moose likes Beginning Java and the fly likes What is the syntax for a Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is the syntax for a "drop down menu"?" Watch "What is the syntax for a "drop down menu"?" New topic
Author

What is the syntax for a "drop down menu"?

Rob Michaelson
Ranch Hand

Joined: Jul 15, 2003
Posts: 36
Hello,
I am looking for the syntax for a drop down menu. Something like "file name:" and then a drop down list of about 6 or 7 names to choose from. Any suggestions?
Rob
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
Originally posted by Rob Michaelson:
Hello,
I am looking for the syntax for a drop down menu. Something like "file name:" and then a drop down list of about 6 or 7 names to choose from. Any suggestions?
Rob

if you're talking about the file menu type drop down generally found at the top left corner of most programs, then what you want is a JMenu, to which you'll add JMenuItems.
but if you're talking about a drop down generally found inside the program, eg if you're using windows, sorry if this is a bad assumption, anyhat, right click your time at the bottom right on your toolbar, select "Adjust Date/Time", the drop down for the months can be created using a JComboBox, you can add any objects to that but in your case its Strings with the different names which you can either add to the JComboBox one at a time or create an Object[] or a Vector and pass that to the constructor when you create the JComboBox
have fun
TQ
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Is this question something to do with JavaScript? Or JSP? Or what?
What's the context?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the syntax for a "drop down menu"?