Home arrow static arrow Java Programming [Archive] - Opening a new window
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Opening a new window
This topic has 1 reply on 1 page.

Posts:67
Registered: 2/8/04
Opening a new window  
Aug 6, 2004 5:39 PM



 
I have a couple applets that I want controlled from one main scrren. I have some buttons on the main screen that I want to open up different applets that I have. How can I make it so that when I click a button on one screen it opens up another applet?
 

Posts:12,831
Registered: 2/22/00
Re: Opening a new window  
Aug 6, 2004 6:04 PM (reply 1 of 1)



 

You could create a java.awt.Frame, and then show it. When you create it, add the applet to it. An applet subclasses java.awt.Panel and you can add a Panel to a Frame.

I presume the same applies to Swing components (JFrames and possibly JPanels, if such exists) but I don't know.

You'd have to call the applet's methods yourself (e.g., init, start). It would only get tricky when you need to pass parameters to the applet.
 
This topic has 1 reply on 1 page.