Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

setUndecorated() isDisplayable() and Parent Frames

Thread view: 
Richard Maher - 22 Mar 2007 22:45 GMT
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
Daniel Pitts - 22 Mar 2007 22:52 GMT
On Mar 22, 3:50 pm, "Richard Maher" <maher...@hotspamnotmail.com>
wrote:
> Hi,
>
[quoted text clipped - 51 lines]
>
> 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.
Joshua Cranmer - 22 Mar 2007 23:48 GMT
> 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().


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.