• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this question something to do with JavaScript? Or JSP? Or what?
What's the context?
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic