I have a GUI with several JTextFields that I populate with setText() with data read from a database. When the data read is longer than the size of the JTextField, the field resizes itself to accommodate the length of the data. However, this causes the whole GUI to become off-balance and look bad. I'd rather just have the data side-scrollable in the field without the size of the field changing. Does anyone know what I need to do? Thanks! [ April 17, 2007: Message edited by: Scott Florez ]
The GUI is pretty complex, so I used NetBeans to design it. Therefore, I have no idea what length each text field needs to be. When I look at the code generated by Netbeans, the only dimensions specified are those of the gaps. Is there any other way to fix the sizes of the fields other than guessing over and over on each field's size (so I can can set the maximum and minimum sizes)? Thanks for the help.
I've been pretty behind with my other projects, so I just now got a chance to try this. Unfortunately, I'm still having the same problem. Any other suggestions?
I initially designed the GUI with NetBeans. I found that there is a constant value called Horizontal Resizable that you can toggle with a checkbox. Some of the text boxes were checked and some weren't. I unchecked all of the check boxes, but unfortunately I'm still having the same problem. It actually caused all of the text fields to lose alignment with each other, plus it didn't fix the initial problem. So I reverted back to the initial version. Does anyone have any other ideas on what I can do? Thanks!