0

I have this undecorated JFrame, and I decided to compress the size of these JTextFields to make the design compact.

enter image description here

The issue is, if a string larger than the text field's length is input by the Browse button in the "Album art" textfield, this happens:

enter image description here

Please help.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Mayukh Nair
  • 623
  • 1
  • 6
  • 26

1 Answers1

0

No idea what layout manager you are using but I would suggest you try creating your text fields with code like:

JTextField textField = new JTextField(10);

The number will give the text field a preferred size so is should not grow as data is entered.

camickr
  • 321,443
  • 19
  • 166
  • 288
  • I use NetBeans IDE 8.0. It does not allow me to do things like create textfields with code because of it's drag-and-drop GUI builder. – Mayukh Nair Oct 29 '14 at 13:55
  • So don't use the IDE. It is always better to learn how to use Java instead of letting the IDE do it for you. Then you don't have problems like this. Also what happens if you change IDE's then you need to learn the IDE all over. – camickr Oct 29 '14 at 14:53
  • If I used code instead of an IDE, I wouldn't have been able to design the JFrame the way I designed it. And, I tell you, letting the SDK do such complex JFrame coding and focusing on the required code is pure nirvana. :) – Mayukh Nair Oct 29 '14 at 23:04