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
Printable View
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
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
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.
Then just add the JComboBox to your panel, frame, etc. Hope this helps!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
In struts FileupLoad concept is there. By Using FileUpload we can upload a file.