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



At 7:43 pm -0700 7/4/05, Josef Henryson <email@hidden> wrote:

That's it!! Thank you so much, now it works both in my JFrame and my modal dialogs (should have thought of that).

Josef

Op 7-apr-05 om 18:20 heeft Rob Ross het volgende geschreven:

>> this.appOpenDialog.setVisible(true);
this.appOpenDialog.enableDefaultButton();
 >
 >
 > If your dialog is a modal dialog, then your code blocks after the
 > first line (setVisible(true)). The next line is executed *after* the
 > dialog has been dismissed by the user. Try switching the order of the
 > two lines.

That, incidentally, is why setVisible() on Dialog ought to be deprecated. For components, yes, show() and hide() are a poor choice, where visibility is a property not very dissimilar from enabledness, opaqueness, bounds, etc.


For a window, however, and most especially a modal dialog, showing it is something quite, quite different. I would always use JDialog.show() to make it quite clear what is happening!

-Rolf
--
Rolf Howarth, Square Box Systems Ltd, Stratford-upon-Avon UK.
_______________________________________________
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


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.