United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4226644 Request a JOptionPane.showInputDialog(Object message, String default) method
JDK-4226644 : Request a JOptionPane.showInputDialog(Object message, String default) method

Details
Type:
Enhancement
Submit Date:
1999-04-05
Status:
Resolved
Updated Date:
2001-11-13
Project Name:
JDK
Resolved Date:
2001-11-13
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.1
Fixed Versions:
1.4.0 (beta)

Related Reports
Relates:
Relates:

Sub Tasks

Description

Name: vi73552			Date: 04/04/99


It would be nice to have a convenient way to show an InputDialog with a default value already entered.

This could be done with either of the following method signatures:
JOptionPane.showInputDialog(Object message, Object default)
JOptionPane.showInputDialog(Object message, String default)


Example usage:

     String name = getLastNameUsed();
     name = JOptionPane.showInputDialog("Enter name", name);


The default value should be selected when the dialog is shown, so that the user can type a new value to replace the default value without having to use the delete or backspace key to delete the default value first.
(Review ID: 56484) 
======================================================================

                                    

Comments
EVALUATION

Yes, this would be convenient (currently the long version of showInputDialog()
must be used).

Adding two new static methods:

	showInputDialog(Object message, Object initialSelectionValue)
	showInputDialog(Component parentcomponent, Object message, 
	                Object initialSelectionValue)

amy.fowler@Eng 2000-03-16

Amy Fowler intends on adding some more code to this fix.  Here's an excerpt from an email from Amy:
"You can move it back to unfixed for now (I have it marked on my
todo list to go back and add the internal frame versions).
I just recommend we do whatever will be the least overhead for
all parties involved....

Aim"

nancy.schorr@eng 2000-06-19

I have opened a new RFE (4526682) for the internal frame version of these methods. Therefore, since the other portion of this bug was integrated some time ago, I am updating the state to integrated.
###@###.### 2001-11-13
                                     
2001-11-13
WORK AROUND



Name: vi73552			Date: 04/04/99


Use the following method:

JOptionPane.showInputDialog(Component parentComponent,
                                     Object message,
                                     String title,
                                     int messageType,
                                     Icon icon,
                                     Object[] selectionValues,
                                     Object initialSelectionValue)
======================================================================
                                     
2004-06-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
merlin-beta

FIXED IN:
merlin-beta

INTEGRATED IN:
merlin-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together