Article View: borland.public.jbuilder.java.language
Article #19276Re: On Dialogs
From: Andrew Bennett
Date: Mon, 23 Feb 1998 00:00
Date: Mon, 23 Feb 1998 00:00
55 lines
3210 bytes
3210 bytes
Conrad Hoesle-Kienzlen wrote: > > Andrew, > but that is just the point: *not* to have to look for the parent frame. If I > have to look for the parent frame as that example (and others posted by you > and Rich)does, then I can't, of course, use a Dialog as a bean, whereas with > my version I can. As for the focus, I always add a this.requestFocus() after > the .show() of the dialog. Apart from that, I could not make out *any* > difference whatsoever (yet) between a dialog that was created with a > "parent" frame and one that was created with a new frame, in fact, I do not > understand why the "parent" frame (whatever that is supposed to mean) is > needed at all. This would mean that an object that does not make use of a > frame cannot instantiate a dialog at all. What's more, somewhere in the > documentation it says that you can set the parent frame of a dialog in the > object inspector. This is not true, at least everytime I tried that, I did > not have that choice. The frame-entry in the object inspector is a drop-down > list and it always only gave me the choice of <none>. > I would be glad if you could clarify this riddle a bit. Hrm. I don't know about the inspector issue with setting the parent off the top of my head. I'd need to play around with that. When you create and pass a new Frame in the constructor, does that new Frame stick around? Say if you popped that dialog up 1000 times. Might you run out of memory because you have all these Frame objects sitting around in the VM? A parent is needed for dialogs so that the dialog can "lock" the parent. Such that, say another app is brought to focus, and after a short time, the user throws focus back to the app that threw the dialog. Assuming they clicked in the area owned by the parent but not by the dialog, the parent would move to the front, and the dialog would be behind it. Try experimenting with File | Open in any app that throws up a dialog when File is clicked. Move focus to another app, then come back. Looking at java.awt, Dialog and Frame both descend from Window, which descends from Container, which descends from Component. So, a dialog is really a fancy Window, and it needs a Frame (aka, a Window) to parent itself off of. Andrew -- Andrew Bennett abennett@borland.com Due to my workload, personal email more than likely won't get a reply. Support options are detailed at http://www.borland.com/devsupport/ I am unable to answer support questions via email at this time. Check http://www.borland.com/devsupport/jbuilder/ for FAQs and additional JBuilder support related help.
Technical Details
Message-ID:
<34F1AEFF.E6E73322@borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34ECB0F1.75915074@csi.com> <34EDBDAA.99232459@borland.com> <34EF2B34.CF380360@csi.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,597eca2139f62518 X-Google-Attributes: gidf74b3,public From: Andrew Bennett <abennett@borland.com> Subject: Re: On Dialogs Date: 1998/02/23 Message-ID: <34F1AEFF.E6E73322@borland.com> X-Deja-AN: 327883528 Content-Transfer-Encoding: 7bit References: <34ECB0F1.75915074@csi.com> <34EDBDAA.99232459@borland.com> <34EF2B34.CF380360@csi.com> Content-Type: text/plain; charset=us-ascii Organization: None Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language