parent Frames in Applets?

I have an application I am converting to an applet.  The dialog boxes will not work unless I pass it a new frame.

Q.  How can I access the parent frame of the browser so that I can stop browser activitiy until the dialog box is answered.
cmg05Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
heyhey_Connect With a Mentor Commented:

Component c = applet;
while (!(c == null || c instanceof Frame))
  c = c.getParent();
 
Frame f = (Frame)c;
if (f == null)
{
  // NEVER happens
  f = new Frame("dummy frame");
}
0
 
cmg05Author Commented:
Adjusted points to 100
0
 
rjackmanCommented:
hi u can do it
if u r adding this code to
init()
then add
Dialog d = new Dialog((Frame)this.getParent,"title",true);//this.getParent will return u container typecast it to Frame

or if u are using it in some other metnod other than init()
then do
declare
private Frame f ;
f = (Frame)this.getParent;
pass this f to constructor of Dialog
Dialog d = new Dialog(f,"title",true);

BestLuck
RickyJackman
0
 
cmg05Author Commented:
i was hoping the dialog would lock out all text feils as well but It does stay on top thanks.
0
All Courses

From novice to tech pro — start learning today.