jump to navigation

Netbeans tip & tricks: Swing dialogs with the wrong size (same as previous dialog) June 13, 2008

Posted by claudio in Uncategorized.
Tags: , ,

Netbeans has a killer feature: it’s graphical Swing builder (aka Matisse). It’s fast, flexible and it works. GUI application in no time. Great.

However, when not creating the GUI by hand, it can be difficult to track some bugs. I found out that when using different JDialogs in the same application, resulting in the dialogs having the same size as the first dialog opened. Pretty annoying. This is how to solve it.

Maybe the bug is a consequence of my choice to use a similar set of dialogs (based on the auto-generated AboutBox). This way I create a show<DialogName> method (an adapted copy paste of the showAboutBox method) to launch the corresponding dialog. Like this, I don’t have to deal with different ways of showing dialogs from the main view.

I discovered that the bug was found in the properties of the source file. All related properties refer to the same form. To solve it, open in the graphical UI view, choose the dialog window, go to properties and change the “name” value into whatever you like (I use the Form<DialogName>, e.g. FormOutput.



1. Henrik - August 12, 2009

Excellent!!! Helepd me alot!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 197 other followers

%d bloggers like this: