Results 1 to 4 of 4

Thread: Drop down menu

  1. #1
    Join Date
    Jan 2008
    Rep Power

    Default Drop down menu

    I'm an 11th grade student taking a java class. What I have is a program that has the user input a file name, and what I want is for the user to pick a file name from a drop down list. Could someone point me in the right direction?


  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    NewEngland, US
    Rep Power


    Just wanted to let you know your thread has been moved to a more proper forum. Please review the FAQ before you post again. :) And welcome to the community. I hope you find a solution to your problem soon.

    See you around!
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  3. #3
    ramapple is offline Member
    Join Date
    Feb 2008
    Rep Power


    Hi BenNeiderLander,

    To pick your name from a drop-down menu, I'd suggest using JComboBoxes. More information can be found here and here.

    A quick example of how it works is by making an array of Strings, and adding it to a JComboBox.

    Java Code:
    String[] names = {"Eugene", "James", "Sarah", "Katherine", "Shari", "Roger"} //declare the names
    JComboBox newBox = new JComboBox(names); //make a new combobox with the names as selections
    Then just add the JComboBox to your panel, frame, etc. Hope this helps!

  4. #4
    Cnu is offline Member
    Join Date
    Feb 2008
    Rep Power


    In struts FileupLoad concept is there. By Using FileUpload we can upload a file.

Similar Threads

  1. Replies: 7
    Last Post: 05-09-2008, 07:54 AM
  2. How to use a drop-down box in Struts
    By piterskiy74 in forum Web Frameworks
    Replies: 1
    Last Post: 02-13-2008, 12:42 PM
  3. Drag and drop
    By abhivenugopal in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 01-30-2008, 03:10 PM
  4. Replies: 3
    Last Post: 12-16-2007, 12:19 AM
  5. help drag and drop in JTabbedPane
    By RO86 in forum AWT / Swing
    Replies: 0
    Last Post: 08-14-2007, 01:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts