There's also a helper method in JOptionPane that returns the heavyweight
window (Frame) underlying a component.

JOptionPane.getFrameForComponent(Component)

This should allow you to set the Applet (or JApplet) as the owner of the
dialog. For instance:

new JDialog(JOptionPane.getFrameForComponent(myApplet), "My Title", true);



-----Original Message-----
From: Marijn H. van der Ploeg [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 28, 2001 11:27 AM
To: Samivelu, Srinivasan; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Setting applet as parent for Jdialog


Hi,

Your problem is, that Applet (or JApplet for that matter ) extends from
Panel in
stead of Frame, so you'd probably be best off if you'd create a JFrame, and
go
from there...

HTH

cheers,

Marijn
----- Original Message -----
From: "Samivelu, Srinivasan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, November 27, 2001 1:11 PM
Subject: Setting applet as parent for Jdialog


: Dear All,
:
: I have few problems to be solved in my Applet program.
:
: 1. I want to set my applet as the owner or parent to the JDialog. I
: find there is no constructor to pass the applet as parent to the JDialog.
Is
: there any workaround to solve this problem.
:
: 2. In case of JFrame, on using the setIcon(Icon icon) method , the
: child dialogs will have the icon set in the frame as icon in the top left
of
: the dialog therby overrides the standard java cup icon.  Is there any
: method or workaround to do the same in  JApplet.
:
: Any workaround or solution to the problems would be much
: appreciated.
:
: Thanks in advance for the efforts taken.
: wkr,
:
: Srinivasan Samivelu
: Software Development Engineer
:
: BarcoNet Private Limited.
: Mailto:[EMAIL PROTECTED]
: http://www.barconet.com
:
:
:
: _______________________________________________
: Advanced-swing mailing list
: [EMAIL PROTECTED]
: http://eos.dk/mailman/listinfo/advanced-swing
:
:


_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to