Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I resize a JTextField? [closed]

How can I resize a JTextField?

like image 320
LockOn Avatar asked Jan 20 '26 10:01

LockOn


1 Answers

If you look at the Javadoc, you'll see that JTextField derives from Component, and that has a setSize() method. If you don't have a layout manager then that's of use.

If you do have a layout manager, then setPreferredSize()/setMinimumSize()/setMaximumSize() is the way to go. See this SO answer for more details.

like image 164
Brian Agnew Avatar answered Jan 21 '26 22:01

Brian Agnew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!