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 84988 - Unsuitable minimum size of forms
Summary: Unsuitable minimum size of forms
Status: RESOLVED WONTFIX
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-15 12:41 UTC by Petr Jiricka
Modified: 2006-10-23 15:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of the form where components are partially hidden (6.99 KB, image/png)
2006-09-15 12:42 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2006-09-15 12:41:33 UTC
Continuous buid from 20060913, Win XP, JDK 1.6 build 97.

1. Design a simple panel by dragging a few components, e.g. the one shown in the
screenshot
2. Click Preview Design
=> It is possible to resize the frame to the point that the components do not
fit in - there should be a reasonable default minimum size so components are
never hidden. 

Note that due to this issue, the form does not look "native", because with
native Windows dialogs this can never happen, as they are not resizeable :-)
Comment 1 Petr Jiricka 2006-09-15 12:42:59 UTC
Created attachment 33999 [details]
Screenshot of the form where components are partially hidden
Comment 2 Jan Stola 2006-09-21 11:04:40 UTC
This is a Swing bug
(see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4320050 ).
and there is no simple workaround.

Note that the bug is claimed to be fixed in JDK 6.0. Unfortunately it doesn't 
mean that it will not be possible to resize windows below their automatically 
_calculated_ minimum size. JDK 6.0 allow you to set some fixed size (using 
setMinimumSize() method) only. We will not generate such a code automatically 
because it would negatively affect windows with dynamic content.

If your window is not dynamic and you are running on JDK 6.0, you can add
yourWindow.setMinimumSize(yourWindow.getMinimumSize());
behind your pack() call to achieve the requested behaviour.
If your window has dynamic content or you are running on JDK 5.0, you can use 
of the (ugly) workarounds mentioned in the comments of the bug 4320050.
Comment 3 Petr Jiricka 2006-09-21 11:38:38 UTC
Thanks for the useful info. We have some issues filed against NetBeans UI about
windows being too small in the Japanese localization, which uses larger fonts.
So I understand there is not really a clean way to fix these issues, especially
because NetBeans still needs to run on JDK 5. 

What exactly do you mean by "dynamic content"? Does this mean windows where some
components appear and disappear based on the window's state, or are these
windows whose components are different each time they are displayed based on
init parameters (but that do not change once the windows are displayed), or does
it mean something else? Thanks.

BTW, I agree with the comments in the JDK bug that this issue makes Java Swing
UI look unprofessional.
Comment 4 Jan Stola 2006-09-21 12:26:12 UTC
> What exactly do you mean by "dynamic content"? 

Windows where some components appear and disappear based on the window's state
(e.g. when some radio button or checkbox is selected) e.g. the windows where 
the minimum size can change after packing (invocation of pack() method) of the 
dialog. For such windows even the support in JDK 6.0 is not sufficient e.g. it 
is not sufficient to call
yourWindow.setMinimumSize(yourWindow.getMinimumSize());