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.
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)
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?
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.