JTextField is not the correct width?

I recently ran an old program I wrote some time ago. I discovered that it does not display like it used to. Please see the following screenshot.

http://www.aniaw.net/_/JTextField.gif

The layout uses JTextField and a GridBagLayout. It displayed perfectly a while ago, but I have since upgraded my JDK.

I was wondering what I can do to make the text fields display properly. My thanks in advance. :)

[422 byte] By [Nirmea] at [2007-11-27 3:05:57]
# 1
use setColumns(int cols) to specify a number of columns for your JTF
calvino_inda at 2007-7-12 3:51:55 > top of Java-index,Java Essentials,Java Programming...
# 2

Swing related questions should be posted in the Swing forum.

If you coded your program correctly and use the pack() method to size the dialog then components should be painted correctly.

However, if you hardcoded the size and the font of the components has changed causing them to become bigger, then sometimes the GridBagLayout will set the components to their minimum size, which probably defaults to 0 for text fields.

camickra at 2007-7-12 3:51:55 > top of Java-index,Java Essentials,Java Programming...