Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to remove selection of initialValue in JOptionPane

 
Mahesh Kedari
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to show JOptionPane with some input value. I expect user to type the text after the input value.

My problem is, when I show this JOptionPane, the initial text is shown selected by default.
So when user starts typing, initial value is replaced with the text user has entered.
Work around for this problem is to ask user to press arrow key and after that, start typing the text.

Is there any way to remove this selection through program when i display the JOptionPane?
 
Mahesh Kedari
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried to override
public void selectInitialValue(); but its still not working.
After some analysis i got to know that the function in JOptionPane for selecting initial value is
pane.selectInitialValue();

Here pane is referring to new instance of JOptionPane. Im not sure if the new instance will use this overridden method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic