Constant size JTextArea and JTextField

How do I make the JTextArea and JTextField to be of a certain size no matter to what I set i t to contain?
mdolandAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CEHJConnect With a Mentor Commented:
>>I want this to work for 1.4.1

It will work afaik for an version >= 1.2
0
 
CEHJCommented:
Provide a custom Document for the components. Override PlainDocument,insertString to allow only a certain length of String
0
 
objectsCommented:
depends on the layout manager being used, but setting the preferred size on most will achieve that

0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
mdolandAuthor Commented:
I want this to work for 1.4.1 and this solution doesn't seem to work here. What would you do?
0
 
mdolandAuthor Commented:
Great, finally got it working. Love it!!
0
 
objectsCommented:
sorry misunderstood what you need.
the folowojgn shows what you need

http://helpdesk.objects.com.au/java/how-to-limit-number-of-characters-in-jtextfield

0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.