Solved

Determining how many characters will fit in a textarea...

Posted on 1998-01-08
1
217 Views
Last Modified: 2012-08-13
I want to know if and how you can determine how many characters can fit in a textarea object at a given size.  I want to make my textarea wrappable, that way text will automatically wrap to the next line when it reaches the bounds of the width of the textarea.  Is this possible and how can I do it?
0
Comment
Question by:spammer
1 Comment
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 1232053
Use the FontMetrics class in java.awt to get the dimensions of both characters and strings.
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

Title # Comments Views Activity
json example 39 135
solarwind tftp server 2 45
Hibernate Not Rolling Back When something fails in a stored procedure 2 52
eclipse shortcuts 9 45
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

863 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

22 Experts available now in Live!

Get 1:1 Help Now