Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Default button



I have been able the get a default button to show the blue pulsing look on a JFrame. The key seems to be setting the default button after the frame is visible. e.g.:

jframe.show();
jframe.getRootPane().setDefaultButton(button);

If you show/hide the frame then you will have to set the default button every time it gets made visible.

--
Dustin Sacks
Sillysoft Games
http://sillysoft.net

On Apr 5, 2005, at 4:40 AM, email@hidden wrote:

The JButton needs to be on a JDialog.
If it is on a JFrame the Aqua Look and Feel will not change its appearance.
The behaviour should be correct though. Press the Enter key and the button
fires the action performed event.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >RE: Default button (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.