Results 1 to 2 of 2
Thread: destroy an applet inside a frame
- 03-28-2010, 05:36 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 9
- Rep Power
- 0
destroy an applet inside a frame
hello, I create an applet, and to be able to run it as an application, I add a main method and create a frame, then I add the applet in that frame, when my applet finish it's work, I want to delete it, because it draw shapes on the frame, however stop or destroy methods didn't work, even applet = null didn't work how can I stop that applet ? remove it completely ?
by the way, there is a timer which always calls paint and update methods of the applet, I think when I destroy the applet, it goes too.
Java Code:public static void main(String[] args) { //JFrame frame = new JFrame(""); GameFrame frame = new GameFrame(); frame.setLocationRelativeTo(null); // Center the frame frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(1024, 768); frame.setVisible(true); testApplet applet = new testApplet(); frame.add(applet, BorderLayout.CENTER); applet.init(); applet.start(); // how can I stop the applet (or destroy it)? }
- 03-28-2010, 05:41 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Destroy object
By anjanesh in forum New To JavaReplies: 11Last Post: 01-02-2010, 07:25 PM -
Returning focus to a frame after hiding another frame
By fletcher in forum AWT / SwingReplies: 7Last Post: 11-02-2009, 06:31 PM -
frame as an applet
By shruti in forum Java AppletsReplies: 0Last Post: 07-18-2009, 11:32 AM -
Behaviour of stop() and destroy()-methods
By Zamppa in forum Java AppletsReplies: 0Last Post: 02-10-2009, 09:50 AM -
Rectangle expands with applet frame
By Godzilla in forum New To JavaReplies: 1Last Post: 07-10-2007, 07:14 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks