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 210829 - JInternalFrame Elongates When Visualization Gaps Change With Mouse Wheel
Summary: JInternalFrame Elongates When Visualization Gaps Change With Mouse Wheel
Status: RESOLVED WONTFIX
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 7.2
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-06 14:15 UTC by MackSix
Modified: 2012-04-11 14:10 UTC (History)
0 users

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 MackSix 2012-04-06 14:15:27 UTC
1.) Create a New JavaSE Project.
2.) Add a New JFrame.
3.) Add a JInternalFrame on JFrame.
4.) Change Visualization Gap with Mouse Wheel.

JInternalFrame keeps getting longer as any gap is changed size.

Also, JInternalFrame gets slightly longer each time another component is added to JFrame.

Product Version: NetBeans IDE Dev (Build 201204050400)
Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 1 Tomas Pavek 2012-04-10 17:55:11 UTC
Reproducible. For some reason the JInternalFrame's content panel is always built 4 pixels bigger vertically than defined by the layout. Strange.

Can be reproduce e.g. as:
1) New form, set it to FlowLayout.
2) Add JInternalFrame, set its layout to AbsoluteLayout.
3) Add a button to the internal frame, move it to 0,0 position.

Now resize the button vertically - you get always an 4 pixels stripe at the bottom of the internal pane, while it should just exactly follow the absolute size of the button. Bug in JInternalFrame?
Comment 2 Jan Stola 2012-04-11 14:10:36 UTC
This is a problem of JInternalFrame. preferredLayoutSize() and layoutContainer() methods of its layout manager (BasicInternalFrameUI.Handler) are not consistent.

The preferred height of JInternalFrame is calculated as

  insets.top + insets.bottom + northPane.height + rootPane.preferredSize.height

Hence, the size of the rootPane should be

  sizeOfInternalFrame - insets.top - insets.bottom - northPane.height

but it is set by layoutContainer() to

  sizeOfInternalFrame - insets.top - insets.bottom + insets.top - northPane.height

i.e. the actual size is larger by insets.top than it should be.

Note that this happens when UIManager.get("InternalFrame.layoutTitlePaneAtOrigin") is "true" only. In other words, it seems to occur on Windows with "XP/Vista" look and feel. It doesn't happen with the Classic look and feel.