• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rob Michaelson
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this question something to do with JavaScript? Or JSP? Or what?
What's the context?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic