
Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Thank you for your help
I have to use this to get it works. Too long !!!!
this.getParent().getParent().getParent().getParent().getParent().setVisible(
false)
I use your code and get
Container:
javax.swing.JPanel[,0,0,500x570,layout=java.awt.BorderLayout,alignmentX=null
,alignmentY=null,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
Container:
javax.swing.JPanel[null.contentPane,0,0,500x570,layout=javax.swing.JRootPane
$1,alignmentX=null,alignmentY=null,border=,flags=9,maximumSize=,minimumSize=
,preferredSize=]
Container:
javax.swing.JLayeredPane[null.layeredPane,0,0,500x570,alignmentX=null,alignm
entY=null,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimized
DrawingPossible=true]
Container:
javax.swing.JRootPane[,4,23,500x570,layout=javax.swing.JRootPane$RootLayout,
alignmentX=null,alignmentY=null,border=,flags=385,maximumSize=,minimumSize=,
preferredSize=]
Container:
super.ManagerWindow[dialog0,0,0,508x597,invalid,layout=java.awt.BorderLayout
,modeless,title=Manager Stocks
,defaultCloseOperation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootPane[,4,23
,500x570,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=
null,border=,flags=385,maximumSize=,minimumSize=,preferredSize=],rootPaneChe
ckingEnabled=true]
Container:
super.SuperApplication[frame0,0,0,350x150,invalid,layout=java.awt.BorderLayo
ut,title=,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JR
ootPane[,3,22,344x125,layout=javax.swing.JRootPane$RootLayout,alignmentX=nul
l,alignmentY=null,border=,flags=385,maximumSize=,minimumSize=,preferredSize=
],rootPaneCheckingEnabled=true]
Andrew Thompson - 30 Jun 2005 01:45 GMT
> Thank you for your help
You're welcome.
> I have to use this to get it works. Too long !!!!
>
> this.getParent().getParent().getParent().getParent().getParent().setVisible(
> false)
(chuckles) That was just to help you *find* it, but is
very fragile. There are probably better ways to get it,
like..
while ( c.getParent() ! instanceof TargetDialogClass ) {
c = c.getParent();
}
..or storing a reference to the parent when constructing, or..

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
shoa - 30 Jun 2005 03:33 GMT
Thank you
I now understand more about getParent() function
> > Thank you for your help
>
> You're welcome.
>
> > I have to use this to get it works. Too long !!!!
this.getParent().getParent().getParent().getParent().getParent().setVisible(
> > false)
>
[quoted text clipped - 7 lines]
>
> ..or storing a reference to the parent when constructing, or..
Vova Reznik - 30 Jun 2005 14:54 GMT
> Thank you
> I now understand more about getParent() function
[quoted text clipped - 18 lines]
>>
>>..or storing a reference to the parent when constructing, or..
It is not about understanding *getParent()* method.
It is about understanding who is the PARENT. :)
Thomas Weidenfeller - 30 Jun 2005 08:40 GMT
> (chuckles) That was just to help you *find* it, but is
> very fragile. There are probably better ways to get it,
[quoted text clipped - 3 lines]
> c = c.getParent();
> }
SwingUtilities.getWindowAncestor()
> ..or storing a reference to the parent when constructing, or..
Or have some central repository where all your top-level windows
register and de-register.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Andrew Thompson - 30 Jun 2005 09:51 GMT
>> while ( c.getParent() ! instanceof TargetDialogClass ) {
>> c = c.getParent();
>> }
>
> SwingUtilities.getWindowAncestor()
..(checks subject line) Good point. I had
completely lost that this was a *Swing* GUI
matter and was thinking 'valid back to 1.1!'
( same old story ;)
As an aside, do you know if that method has
been available since the introduction of Swing?
The javadocs are a bit vague on some of the
'@since' tags..

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Thomas Weidenfeller - 30 Jun 2005 12:17 GMT
> As an aside, do you know if that method has
> been available since the introduction of Swing?
AFAIK it was added for 1.3
> The javadocs are a bit vague on some of the
> '@since' tags..
That's an understatement. Correct @since tags seem to be completely out
of the scope of Sun's QA.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Vova Reznik - 30 Jun 2005 15:00 GMT
>> (chuckles) That was just to help you *find* it, but is
>> very fragile. There are probably better ways to get it, like..
[quoted text clipped - 11 lines]
>
> /Thomas
SwingUtilities.getWindowAncestor(Component)
or
jComponent.getTopLevelAncestor()