tags:

views:

170

answers:

2

help me please..

A: 

If you look at the Javadoc, you'll see that JTextField derives from Component, and that has a setSize() method.

Brian Agnew
Downvoted *why* ?
Brian Agnew
Layout managers will call setSize() and override your size. It is better to use setPreferredSize(), setMinimumSize(), and setMaximumSize().
Jay Askren
+3  A: 

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.

John