• Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane: Combobox coming instead JTextField  RSS feed

 
Jeevan Anand
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using following syntax of JOptionPane as I need to provide, title also and initial selection value in textfield. The problem is I m finding combo box instead of JTextField. In specification I found written "It is up to the UI to decide how best to represent the selectionValues, but usually a JComboBox, JList, or JTextField will be used." Let me know how should I correct the code to get JTextField:

String[] selectedValue = {Name};
String newName = (String) JOptionPane.showInputDialog(this, chatBundle.getString("Enter_Name"), chatBundle.getString("Enter_Chat"), JOptionPane.QUESTION_MESSAGE, null ,selectedValue , selectedValue[0]);

Thanks in advance.
 
Jeevan Anand
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got the solution. Using null for selectionValue getting me JTextfield.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!