wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "TextArea and TextField Classes" Watch "TextArea and TextField Classes" New topic
Author

TextArea and TextField Classes

Sushma
Ranch Hand

Joined: Feb 24, 2000
Posts: 36
Hi,
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???
thanks
Sushma
Mike Broad
Greenhorn

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.
-Mike
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.
Sushma
Ranch Hand

Joined: Feb 24, 2000
Posts: 36
Thank u... Deepa and Mike
 
Consider Paul's rocket mass heater.
 
subject: TextArea and TextField Classes
 
Similar Threads
Layout
///incompatible types///
Some confusing ones part 3
AWT TextArea not recognising focus with Tab key
Jtable, Jtextarea