Re: Applet and parent browser
On Thu, 19 Jan 2012 14:58:56 -0800 (PST), simplicity
<stella_pigeon@live.ca> wrote, quoted or indirectly quoted someone who
said :
Window title is not what I need. I just mentioned it because I thought
that checking it may be used as a form of debugging.
what you might need is
/**
* find Frame/JFrame enclosing a
Component/Container/Dialog/Applet... Returns null if can't find one.
* Useful when you need to pass the enclosing Frame to to a
JDialog constructor.
*
* @return Frame, will be typically not be a literal Frame, but a
* javax.swing.JFrame, sun.applet.AppletViewer, class
sun.plugin2.main.client.PluginEmbeddedFrame (For JApplet)
*/
public static Frame getParentFrame( Component child )
{
Container c = child.getParent();
while ( c != null )
{
if ( c instanceof Frame )
{
return ( Frame ) c;
}
c = c.getParent();
}
return null;
}
--
Roedy Green Canadian Mind Products
http://mindprod.com
One of the most useful comments you can put in a program is
"If you change this, remember to change ?XXX? too".