setUndecorated() isDisplayable() and Parent Frames

D

Daniel Pitts

Hi,

Below is the question I was about to post before it occured to me that I was
just making another schoolboy error and attempting to change the parent
frame instead of the frame for my new dialog box.

OK, that problem is fixed, but can someone tell me if the parent frame for
such an Applet is in fact the Browser? And if so, is it concievable that
methods such a parentFrame.setTitle("Unlikely") and repaint() (send events,
minimise) would work on the browser? Given that one's an apple and the
other is a pineapple it could be ludicrous to suggest the possibility of
such tight coupling, but then surely only forces beyond my understanding
could put the Browser frame in an inventory available to getParent()?

Cheers Richard Maher

Hi,

I have an Applet that is being invoked in a web browser that has html
"width" and "height" both set at 0. In the init() method I want to create a
dialog box and need a Frame so I have been using the following logic to
locate one: -

Object parentFrame = getParent();
while ((parentFrame != null) &&
!(parentFrame instanceof Frame))
{
parentFrame = ((Component)parentFrame).getParent();
}

Frame creds = (Frame)parentFrame;
: : : :
Tier3Welcome welcome = new Tier3Welcome(creds, appl, pipe.t3IdBuf);

In Tier3Welcome I do: -

public class Tier3Welcome extends Dialog
implements ActionListener

public Tier3Welcome(Frame wframe, String AppName, byte[] t3IdBuf)
{
super(wframe,"Tier3 Confirmation",true);

What I'd like to do now is wframe.setUndecorated(true); but I'm getting the
well-documented IllegalComponentStateException. I've looked up the docs for
Component.isDisplayable() but am still none the wiser as to how to make my
Frame "undisplayable" long enough to make it "undecorated". Should I forget
about getting a "parent" frame and just Frame x = new Frame(); and pass in X

to my Tier3Welcome class? What is the Parent Frame anyway? The Browser?
Portion of the Browser?

<epiphany here: "this".setUndectorated(true) *not* "wframe"> - Doh!

Cheers Richard Maher

My guess is that the parent for an Applet is null, and for an Dialog
it is the owning window, which is still in Java land, not browser land.
 
J

Joshua Cranmer

Daniel said:
My guess is that the parent for an Applet is null, and for an Dialog
it is the owning window, which is still in Java land, not browser land.

Your guess is correct for Applet in the general case (i.e., it is
probably null except in exceptional circumstances).

For Dialog, getParent() should return null, seeing as neither Window nor
Dialog overrides getParent().
 
R

Richard Maher

Hi,

Below is the question I was about to post before it occured to me that I was
just making another schoolboy error and attempting to change the parent
frame instead of the frame for my new dialog box.

OK, that problem is fixed, but can someone tell me if the parent frame for
such an Applet is in fact the Browser? And if so, is it concievable that
methods such a parentFrame.setTitle("Unlikely") and repaint() (send events,
minimise) would work on the browser? Given that one's an apple and the
other is a pineapple it could be ludicrous to suggest the possibility of
such tight coupling, but then surely only forces beyond my understanding
could put the Browser frame in an inventory available to getParent()?

Cheers Richard Maher

Hi,

I have an Applet that is being invoked in a web browser that has html
"width" and "height" both set at 0. In the init() method I want to create a
dialog box and need a Frame so I have been using the following logic to
locate one: -

Object parentFrame = getParent();
while ((parentFrame != null) &&
!(parentFrame instanceof Frame))
{
parentFrame = ((Component)parentFrame).getParent();
}

Frame creds = (Frame)parentFrame;
: : : :
Tier3Welcome welcome = new Tier3Welcome(creds, appl, pipe.t3IdBuf);

In Tier3Welcome I do: -

public class Tier3Welcome extends Dialog
implements ActionListener

public Tier3Welcome(Frame wframe, String AppName, byte[] t3IdBuf)
{
super(wframe,"Tier3 Confirmation",true);

What I'd like to do now is wframe.setUndecorated(true); but I'm getting the
well-documented IllegalComponentStateException. I've looked up the docs for
Component.isDisplayable() but am still none the wiser as to how to make my
Frame "undisplayable" long enough to make it "undecorated". Should I forget
about getting a "parent" frame and just Frame x = new Frame(); and pass in X

to my Tier3Welcome class? What is the Parent Frame anyway? The Browser?
Portion of the Browser?

<epiphany here: "this".setUndectorated(true) *not* "wframe"> - Doh!

Cheers Richard Maher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top