Article View: borland.public.jbuilder.java.swing
Article #11225Re: JFrame, JDialog and Focus
From: Gavster McRavster
Date: Wed, 30 Jun 1999 00:00
Date: Wed, 30 Jun 1999 00:00
58 lines
2628 bytes
2628 bytes
your problem seems to me to be that you need to get a handle on the root
applet so that you can then build children any which way you like. obviously
you'll have to preserve this reference yourself in each child frame/dialog.
(this means you have to use extensions to the JDialog class that declare
references to the original parent applet)
- This can be done using a declaration and statement in the root applet
(called RootApplet.java), like:
public static RootApplet parentApplet;
and then in init() method of the applet:
{
parentApplet = this;
..
}
dialogs / child frames can then be access the reference to the parent from
anywhere simply by referencing
JApplet myParentApplet = RootApplet.parentApplet;
myParentApplet is the handle you need
hope this is of some help
Michael H�rtig <haertig@nupis.de> wrote in message
news:3779FA2A.189F8126@nupis.de...
> Hi all,
>
> I have an JApplet. It creates a JFrame. This JFrame creates a JDialog.
> From this JDialog I want to open a second frame. My problem is:
> In an applikation all it's ok. Starting the same code as an Applet I
> can't activate the new JFrame. It beeps. I have to switch back to the
> original JFrame, close the dialog, and then the new Frame can grab the
> focus.
> Any ideas????
>
> Michael
>
>
> --
> ////
> (o o)
> +-----ooO--(_)--Ooo---------------------------------------+
> | |
> | Michael H�rtig Neumann & Partner |
> | Informationssysteme GmbH |
> | Softwareentwicklung An der Hohen Stra�e 1 |
> | 08393 Meerane |
> | |
> +------------Oooo-----------------------------------------+
> oooO ( )
> ( ) (_)
> (_)
Technical Details
Message-ID:
<930745994.10796.0.nnrp-09.c1c3e175@news.demon.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3779FA2A.189F8126@nupis.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,fff2e23b2d974357 X-Google-Attributes: gid111d45,public From: "Gavster McRavster" <gavinc@demon.net> Subject: Re: JFrame, JDialog and Focus Date: 1999/06/30 Message-ID: <930745994.10796.0.nnrp-09.c1c3e175@news.demon.co.uk> X-Deja-AN: 495585853 X-NNTP-Posting-Host: gavinc.eng.demon.net:193.195.225.117 References: <3779FA2A.189F8126@nupis.de> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 930745994 nnrp-09:10796 NO-IDENT gavinc.eng.demon.net:193.195.225.117 X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing