Solved

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

Posted on 1998-01-08
1
206 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
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 scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

743 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

12 Experts available now in Live!

Get 1:1 Help Now