aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to remove selection of initialValue in JOptionPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to remove selection of initialValue in JOptionPane" Watch "How to remove selection of initialValue in JOptionPane" New topic
Author

How to remove selection of initialValue in JOptionPane

Mahesh Kedari
Ranch Hand

Joined: Nov 28, 2009
Posts: 111
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?


Regards,
Mahesh Kedari - Fidus Technologies Ltd.
Mahesh Kedari
Ranch Hand

Joined: Nov 28, 2009
Posts: 111
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to remove selection of initialValue in JOptionPane