jQuery in Action, 3rd edition
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes TextArea and TextField Classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "TextArea and TextField Classes" Watch "TextArea and TextField Classes" New topic

TextArea and TextField Classes

Ranch Hand

Joined: Feb 24, 2000
Posts: 36
If i create a TextField with 5 columns and a TextArea with 6 rows and 7 columns what would be the display, i mean how many characters would i see if i had created them with a 20 letter( as in "abcdefghijklmnoprere") text???
Mike Broad

Joined: Mar 29, 2007
Posts: 13
The characters you see is going to depend on the font you use. Fixed width fonts would show 5 characters across the TextField and 7 across the TextArea. The remaining characters would scroll off to the right.
If you use variable-width font then the number of characters displayed depends on the letter you are writing. For example you would see a lot more i's than you would see w's.
Deepa sivasankar
Ranch Hand

Joined: Jul 22, 2003
Posts: 35
For fixed width font, the number of characters is the size of the text field. For variable width font , it is the average width of the all the characters in the text field.
Hope this helps.
Ranch Hand

Joined: Feb 24, 2000
Posts: 36
Thank u... Deepa and Mike
I agree. Here's the link: http://aspose.com/file-tools
subject: TextArea and TextField Classes
It's not a secret anymore!