[#781] - Minor Usability improvement

Category:
Feature request
Priority:
Low
Status:
Assigned
Project: Severity:
Trivial
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

Issue moved from:
https://sourceforge.net/tracker/index.php?func=detail&aid=1503617&group_...

Consult the original issue for any attachments.

[ 1503617 ] Minor Usability improvement

Submitted By: davidecr - davidecr
Date Submitted: 2006-06-09 09:51
Last Updated By: Item Submitter - Tracker Item Submitted
Date Last Updated: No updates since submission
Number of Comments: 0
Number of Attachments: 0
Category: Interface Improvements (example)
Group: Next Release
Assigned To: Nobody/Anonymous
Priority: 5

Summary:
Minor Usability improvement

Hi, sorry if this is not the place to put this I think it is... This are two minor improvements... handle ESCAPE key and make the ok button the default button...maybe you dont need this code but I put it any way if it can help you...

//in the jdialog constructor

//Handle escape key to close the dialog
KeyStroke escape =
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);
Action escapeAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
dispose();
}
};

getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape,
"ESCAPE");
getRootPane().getActionMap().put("ESCAPE",
escapeAction);

//to make the default button ...
this.getRootPane().setDefaultButton(defaultBtn);

... I was looking and there are a lot of other things that can be improved in details like this... If you think this is important and need a hand with some swing code I'm interested in participate in an open source project in my free time...

davidecr (at) gmail (dot) com

--
David Castañeda

No follow-up comments have been posted.

No Files Currently Attached

tcloonan's picture
1831
Joined: Dec 22 2006 - 1:13am
Last seen: 16 years 9 months ago
Feedback
randomness