T
troy makaro
Hi, I'm using the java plugin version 1.5.0_5 and every time I go from my
web page that has the applet to another web page the applet.destroy() method
occurs and all my resources are closed. My threads are closed, my JFrames
are closed and my PipedInputStream and PipledOutputStream are closed. I
tried storing these resouces in a static field which does keep the objects
but the objects are still dead. Is there any way to keep these resources
alive? Here is a simple test:
public class AppletBase extends JApplet {
public void init() {
JButton button = new JButton("Push me2");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFrame frame = new JFrame("Title");
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.getContentPane().add(new JTree());
frame.pack();
frame.setVisible(true);
}
});
getContentPane().setLayout(new FlowLayout());
getContentPane().add(button);
}
}
In the above example, that frame will close when the browser with the applet
goes to another web page. How can I get the frame to stay?
If I can't do it within the applet sandbox how about if I sign the applet?
Troy
Troy
web page that has the applet to another web page the applet.destroy() method
occurs and all my resources are closed. My threads are closed, my JFrames
are closed and my PipedInputStream and PipledOutputStream are closed. I
tried storing these resouces in a static field which does keep the objects
but the objects are still dead. Is there any way to keep these resources
alive? Here is a simple test:
public class AppletBase extends JApplet {
public void init() {
JButton button = new JButton("Push me2");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFrame frame = new JFrame("Title");
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.getContentPane().add(new JTree());
frame.pack();
frame.setVisible(true);
}
});
getContentPane().setLayout(new FlowLayout());
getContentPane().add(button);
}
}
In the above example, that frame will close when the browser with the applet
goes to another web page. How can I get the frame to stay?
If I can't do it within the applet sandbox how about if I sign the applet?
Troy
Troy