[SWINGX-1343] JXStatusBar incorrectly returns preferred size for minimum size Created: 10/Sep/10  Updated: 28/Jan/11  Resolved: 01/Nov/10

Status: Resolved
Project: swingx
Component/s: Misc Component
Affects Version/s: 1.6.2
Fix Version/s: 1.6.3

Type: Bug Priority: Major
Reporter: arren Assignee: Karl Schaefer
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 1,343

 Description   

JXStatusBar is blowing up parent containers. It needs a minimum width of 0.

A JXLabel or JLabel has a preferred size which is the render size of its text.

JXStatusBar has a LayoutManager in BasicStatusBarUI which uses the preferred
size as the minimum size.

If you put a JXLabel into a JXStatusBar, then the JXStatusBar minimum size is
then the size of the text.

This blows the enclosing window out of proportion.

If you override getMinimumSize() in JXStatusBar to return a 0 width, with the
preferred height, then all behaves correctly.

Proper fix: The LayoutManager in BasicStatusBarUI should return 0 width (and
possibly height) from minimumSize().



 Comments   
Comment by Karl Schaefer [ 11/Sep/10 ]

It is not necessarily a bug for a component's minimum size to be the same size
as its preferred size. In fact a lot of core components do just that.

Please provide a test case (self-contained and runnable) that demonstrates why
having JXStatusBar's minimum size equal its preferred size is a bug.

Comment by Karl Schaefer [ 07/Oct/10 ]

No test case. Resolving invalid.

Generated at Tue May 03 18:51:38 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.