This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 77215 - setDefaultCloseOperation problem
Summary: setDefaultCloseOperation problem
Status: VERIFIED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-01 10:29 UTC by Jaromir Uhrik
Modified: 2008-12-23 00:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaromir Uhrik 2006-06-01 10:29:21 UTC
1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-b02
Windows XP version 5.1 running on x86
en_US (nb); Cp1252

Steps to reproduce:
1.Create new NetBeans Plug-in Modules|Module Project
2.Create new JFrame Form with name e.g. MyFrame
3.Create new Action and write to its performAction()method:
new MyFrame().setVisible(true);

When the action is invoked then the MyFrame form is not displayed. The problem
is in code setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE).
Comment 1 Tomas Danek 2006-06-01 12:35:20 UTC
see 70145, i've also met this..
Comment 2 Petr Nejedly 2006-06-01 15:43:45 UTC
I'd argue that core/execution behaves right here. The SecMan just report that
exit () is not allowed (and potentially kill the thread group trying to perform
exit).
It is strange that the JFrame mode setter checks the exit right that early, but
the exception would be there after closing the window anyway (but swallowed one).

It is questionable whether we should hide the ExitSecurityException in the AWT
thread handler (as we're doing now) when the IDE no longer support internal
execution. Not hiding it would immediatelly reveal the real problem (=you must
not call System.exit() inside the IDE).

Reassigning to core/code for evaluation (NbErrorManager does the filtering,
cc-ing Yarda)
Comment 3 Jaroslav Tulach 2006-06-19 13:04:25 UTC
I do not think there is anything else to do. We need to prevent System.exit(0) 
and we do it using our own security manager. However, the 
jFrame.setDCO(EXIT_ON_CLOSE) uses the same query and there does not seem to be 
a way to distinguish between those two calls. 

Anyway even this one succeded, there would be the exception during closing the 
frame...
Comment 4 Jaromir Uhrik 2006-08-28 10:00:26 UTC
Marking issue as VERIFIED.