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 82958 - Some JInternalFrame properties should be set after container.add()
Summary: Some JInternalFrame properties should be set after container.add()
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 82957 83683 87183 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-18 05:37 UTC by jaimeschettini
Modified: 2006-10-23 16:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Debug log of the JInternalFrame (1.05 KB, application/octet-stream)
2006-08-18 05:38 UTC, jaimeschettini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jaimeschettini 2006-08-18 05:37:12 UTC
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?
Comment 1 jaimeschettini 2006-08-18 05:38:24 UTC
Created attachment 33050 [details]
Debug log of the JInternalFrame
Comment 2 Jan Stola 2006-08-18 10:31:52 UTC
*** Issue 82957 has been marked as a duplicate of this issue. ***
Comment 3 Jan Stola 2006-08-18 10:38:57 UTC
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.
Comment 4 Jan Stola 2006-08-29 14:01:17 UTC
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
Comment 5 Jan Stola 2006-08-29 14:04:53 UTC
*** Issue 83683 has been marked as a duplicate of this issue. ***
Comment 6 Tomas Pavek 2006-09-22 15:30:55 UTC
Fixed. The properties are set after adding to the parent.
Comment 7 Jan Stola 2006-10-16 11:00:52 UTC
*** Issue 87183 has been marked as a duplicate of this issue. ***