Solved

Constant size JTextArea and JTextField

Posted on 2009-04-08
7
402 Views
Last Modified: 2013-11-23
How do I make the JTextArea and JTextField to be of a certain size no matter to what I set i t to contain?
0
Comment
Question by:mdoland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 24095036
Provide a custom Document for the components. Override PlainDocument,insertString to allow only a certain length of String
0
 
LVL 92

Expert Comment

by:objects
ID: 24102993
depends on the layout manager being used, but setting the preferred size on most will achieve that

0
 

Author Comment

by:mdoland
ID: 24158355
I want this to work for 1.4.1 and this solution doesn't seem to work here. What would you do?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 24158617
>>I want this to work for 1.4.1

It will work afaik for an version >= 1.2
0
 

Author Closing Comment

by:mdoland
ID: 31567909
Great, finally got it working. Love it!!
0
 
LVL 92

Expert Comment

by:objects
ID: 24202159
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 24202194
:-)
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question