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.
I'm using a MDI application. I set in my jinternalframe properties the option maximum, so the frame was going to be maximized when i call for debug my program. But when i debug the project, the following appears: Exception in thread "main" java.lang.NullPointerException and the application doesn't run. I set this manually (jinternalframe.setMaximum(true);) with exception treatment and the application ran naturally. But i want to set this option like so many others: in my dessign view. Anyone knows this problem? Is this a bug? Can I fix this in netbeans generated code?
Created attachment 33050 [details] Debug log of the JInternalFrame
*** Issue 82957 has been marked as a duplicate of this issue. ***
The setMaximum() method sets its internal 'isMaximum' flag and then attempts to resize itself according to size of its parent. Unfortunately the property setters are generated before container.add() method. The internal frame therefore doesn't have a parent by the time the setMaximum() method is called. This results in NPE. It is a JInternalFrame's (resp. DefaultDesktopManager's) bug IMHO, but we can work around it by generation of the setMaximum() statement behind the container.add() method.
There is a similar situation with 'icon' property of JInternalFrame. It doesn't work correctly, if it is set before container.add(). See issue 83683 and the corresponding issue on java.sun.com http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4769772
*** Issue 83683 has been marked as a duplicate of this issue. ***
Fixed. The properties are set after adding to the parent.
*** Issue 87183 has been marked as a duplicate of this issue. ***