• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JOptionPane showInputDialog : own textfield or combobox

 
Alex Iordache
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic