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?
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
All Courses

From novice to tech pro — start learning today.