Results 1 to 4 of 4

Thread: Drop down menu

  1. #1
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0

    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?

    Thanks,
    Ben

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

    Default

    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!
    -Capt
    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
    Posts
    7
    Rep Power
    0

    Default

    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
    Cnu is offline Member
    Join Date
    Feb 2008
    Posts
    13
    Rep Power
    0

    Default

    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, 11:42 AM
  3. Drag and drop
    By abhivenugopal in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 01-30-2008, 02:10 PM
  4. Replies: 3
    Last Post: 12-15-2007, 11:19 PM
  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
  •