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 148432 - LAYOUT: Incorrect preview/handling of some gaps
Summary: LAYOUT: Incorrect preview/handling of some gaps
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks: 136425
  Show dependency tree
 
Reported: 2008-09-25 22:14 UTC by jerryschreiber
Modified: 2012-06-15 06:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NetBeans 6.5 Project TabbedPaneWidthProblem (22.30 KB, application/octet-stream)
2008-09-25 22:19 UTC, jerryschreiber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jerryschreiber 2008-09-25 22:14:10 UTC
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.
Comment 1 jerryschreiber 2008-09-25 22:19:53 UTC
Created attachment 70631 [details]
NetBeans 6.5 Project TabbedPaneWidthProblem
Comment 2 Peter Pis 2008-09-25 22:27:26 UTC
Reassigning to form.
Comment 3 Jan Stola 2008-09-29 15:13:42 UTC
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.
Comment 4 Tomas Pavek 2012-06-14 17:30:51 UTC
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
Comment 5 Quality Engineering 2012-06-15 06:11:24 UTC
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