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: Java update 1.5.0.05 and FileDialog



At 6:06 pm -0800 17/11/05, Bill Stackhouse wrote:
At 8:55 PM +0200 11/17/05, George Birbilis wrote:
You are using "setVisible" with AWT FileDialog, maybe you should use some
"show" or similar method instead

Actually setVisible(boolean) is the method to use. show()/hide() is deprecated and called by setVisible.

Common misconception. Component.show() is deprecated, as it's considered to be setting a property on the component, much like location, size, etc., and won't actually show it unless the parent window is shown.


Window.show() (including Dialog.show() and Frame.show()) is NOT deprecated. This does much more than simply set a property and return. In the case of a modal dialog for example it blocks until the user closes the dialog. Quite some side effect for a simple set() method :-)

You're right, it doesn't matter which you call as one calls the other, but as a matter of style I think it's preferable to call show() on windows (and it's setVisible that should be deprecated), otherwise you risk obscuring the fact that you're actually performing a fairly substantial action in that call. (Consider: most properties on a component, such as their font, colour, etc. and even their visibility can safely be left with their default values and they will be usable, but that clearly doesn't apply when calling setVisible on a window).

-Rolf
--
Rolf Howarth
Square Box Systems Ltd
Stratford-upon-Avon UK.
http://www.squarebox.co.uk
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-java/email@hidden

This email sent to email@hidden
References: 
 >RE: Java update 1.5.0.05 and FileDialog (From: Bill Stackhouse <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.