This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JOptionPane showInputDialog : own textfield or combobox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JOptionPane showInputDialog : own textfield or combobox" Watch "JOptionPane showInputDialog : own textfield or combobox" New topic
Author

JOptionPane showInputDialog : own textfield or combobox

Alex Iordache
Ranch Hand

Joined: Mar 13, 2001
Posts: 62
Hi,
Reading the API of JOptionPane in the most parameters showInputDialog (see copy below), at the end I
read :
It is up to the UI to decide how best to represent the selectionValues, but usually a JComboBox, JList,
or JTextField will be used.
How can I self make a "JOption input pane", where I already have set a value in the inputfield of the
pane?
Please add codesnippit,
Thanks,
javabit
showInputDialog
public static Object showInputDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon,
Object[] selectionValues,
Object initialSelectionValue)

Prompts the user for input in a blocking dialog where the initial selection, possible selections, and
all other options can be specified. The user will able to choose from selectionValues, where null implies
the user can input whatever they wish, usually by means of a JTextField. initialSelectionValue is the
initial value to prompt the user with. It is up to the UI to decide how best to represent the selectionValues,
but usually a JComboBox, JList, or JTextField will be used.
 
Don't get me started about those stupid light bulbs.
 
subject: JOptionPane showInputDialog : own textfield or combobox
 
Similar Threads
Dual inputs in JOptionPane ( Is it possible)?
Swing JOptionPane showInputDialog : own textfield or combobox
JOptionPane showInputDialog default selection
JOptionPane: Combobox coming instead JTextField
How to add JtextField to JOptionPane