Solved

Constant size JTextArea and JTextField

Posted on 2009-04-08
7
392 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

943 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now