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.
When the JFrame is in Design View and the Preview Design button is pressed, the screen has the desired width. But when the application is run and the screen is presented, it is half again as wide! The JFrame containing a Tabbed Pane which itself contains a Panel with 16 buttons. The JFrame started as part of a SingeFrameApplication, so the generated code refers to the org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(tabbedpaneproblem.TabbedPaneProblem.class).getContext().getResourceMap(PickingFrameTabs.class); But otherwise, the example I have whittled down does not rely on the SingleFrameApplication methods. I have tried reproducing the JFrame 'from scratch', i.e. with no connection to the resourceMap, and do not have this problem. I will be happy to submit the code which results in this problem.
Created attachment 70631 [details] NetBeans 6.5 Project TabbedPaneWidthProblem
Reassigning to form.
I was able to reproduce this issue using the attached project. It has nothing to do with application framework. It is caused by a strange layout of this form (the generated code shows that it is not a simple 4x4 grid as it might seem at the first sight). You probably wasn't able to reproduce this problem without app. framework because you weren't able to recreate this strange layout. There is a workaround that fixes this layout: 1. Select the buttons in the fourth column (e.g. 01-4, 02-4, 03-4 and 04-4). 2. Press 'Align left in column' button in GUI builder's toolbar. 3. Select one button in the fourth column and invoke Space Around Component ... action from its contextual menu. 4. Set the size of Right gap to Default and press OK. Keeping this issue opened because you are right that the preview (even of such a strange layout) should match the layout produced in run-time.
The big gap at the right side that is visible when running really exist in the form. The form is set up in such a way that the actual size of the JTabbedPane is smaller than its preferred and minimum size (hiding the sticking out gap in the enclosed panel). The GUI designer builds the UI right to follow the setup. It is the code that is not generated correctly. The code generator did not recognize that the JTabbedPane's actual size was smaller than minimum because it used wrong JTabbedPane instance for the check. I fixed that. Unfortunately the fix did not make it in for 7.2. http://hg.netbeans.org/jet-main/rev/baccb67bca09
Integrated into 'main-golden', will be available in build *201206150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/baccb67bca09 User: Tomas Pavek <tpavek@netbeans.org> Log: #148432: to evaluate actual min size when generating code, the real component from designer should be used if possible