Solved

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

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum5 challenge 5 84
ArrayIndexOutOfBoundException 9 82
Can anyone please tell me why i can not find ID  investorCoolGrid inside the jsp page? 1 20
jboss wildfly 10.1 10 94
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)
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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.

777 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