Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #1357
| From | "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: Giving JDialog the co |
| Message-ID | <700ce1ff1293b@uwe> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <460f7681$1@dnews.tpgi.com.au> |
| Date | 2011-04-27 15:32 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui Lionel van den Berg wrote: >Often I find an error or want to give the user some information I am >doing so in a class that is an extension of JPanel. However, this JPanel >may have another JPanel as it's parent, or some other Container class. . >Providing null to a JDialog means that if I click on another window and >then back onto the original, the dialog dis-appears behind the main window. > >Does anyone have a design solution to this? I am still not sure what the question is, but note that if you can find your way back to the 'root' JFrame/JWindow etc., you can use that as the owner of the JDialog. Methods that might help with this are possibly..* JComponent.getRootPane(), or a loop that asks for the Component.getParent() until getParent() returns 'null' (that Component will be the JFrame or JWindow). * ..and I am sure there is a method that actually returns the JFrame/JWindow directly, but I cannot recall what it is, at this moment. -- Andrew Thompson http://www.athompson.info/andrew/ --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Giving JDialog the correc "Lionel van den Berg" <lionel.van.den.berg@THRWHITE.remove-dii-this> - 2011-04-27 15:32 +0000
Re: Giving JDialog the co "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:32 +0000
Re: Giving JDialog the co "Dan Andrews" <dan.andrews@THRWHITE.remove-dii-this> - 2011-04-27 15:32 +0000
Re: Giving JDialog the co "Lionel van den Berg" <lionel.van.den.berg@THRWHITE.remove-dii-this> - 2011-04-27 15:32 +0000
csiph-web