-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0
-
None
-
merlin
-
generic
-
generic
We have encountered the following problem with the swing JOptionPane.
We use Swing version 1.0.1 together with JDK 1.1.5.
Problem:
I you create an JOptionPane with setOptions( Object[] ) with a non-null argument, and setWantsInput( true ), the input value from the user is not returned correctly from the getInputValue() method when you return from the show() method as a result from pressing one of the buttons.
The correct input value is returned though if you close the JOptionPane dialog by pressing the return key when the input field has focus.
Solution:
The fault has been located to BasicOptionPaneUI in method createdButtonFired(int buttonIndex). The call to method resetInputValue(), that will update the users input value, is only called if predefined buttons (as defined by setOptionType(int)) are used.
We use Swing version 1.0.1 together with JDK 1.1.5.
Problem:
I you create an JOptionPane with setOptions( Object[] ) with a non-null argument, and setWantsInput( true ), the input value from the user is not returned correctly from the getInputValue() method when you return from the show() method as a result from pressing one of the buttons.
The correct input value is returned though if you close the JOptionPane dialog by pressing the return key when the input field has focus.
Solution:
The fault has been located to BasicOptionPaneUI in method createdButtonFired(int buttonIndex). The call to method resetInputValue(), that will update the users input value, is only called if predefined buttons (as defined by setOptionType(int)) are used.