How to display a new frame in an an applet?

Posted by mithun1538 on Stack Overflow See other posts from Stack Overflow or by mithun1538
Published on 2010-03-25T10:08:51Z Indexed on 2010/03/25 10:13 UTC
Read the original article Hit count: 430

Filed under:
|

Hello everyone,

I have an applet. In this I have a JLabel component. When the user clicks this label, a new JFrame component gets displayed. I want to set the value of setDefaultCloseOperation() for this frame as JFrame.EXIT_ON_CLOSE. However, I get a SecurityException if I do that. I read the documentation of JFrame.EXIT_ON_CLOSE and its written that :

The exit application default window close operation. If a window has this set as the close operation and is closed in an applet, a SecurityException may be thrown. It is recommended you only use this in an application.

What I understood from the above is that if a frame is closed without specifying default close operation, the frame is only hidden. I want to close the frame when the user tries to close it, and not hide the frame. Is this possible?

© Stack Overflow or respective owner

Related posts about applet

Related posts about jframe