Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1357

Re: Giving JDialog the co

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.alt.net!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Subject Re: Giving JDialog the co
Message-ID <700ce1ff1293b@uwe> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <460f7681$1@dnews.tpgi.com.au>
References <460f7681$1@dnews.tpgi.com.au>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 33
Date Wed, 27 Apr 2011 15:32:51 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918371 96.60.20.240 (Wed, 27 Apr 2011 10:32:51 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:32:51 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:1357

Show key headers only | View raw


  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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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