How can I resize a JTextField? [closed]
How can I resize a JTextField?
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.
The jtextfield tutorial tells you about setColumns(), which might be what you want. Otherwise, you might need to learn about how to use layout managers - here's a tutorial.
精彩评论