This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes TextField tf = new TextField( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "TextField tf = new TextField("this is for",40);" Watch "TextField tf = new TextField("this is for",40);" New topic
Author

TextField tf = new TextField("this is for",40);

sarim raza
Ranch Hand

Joined: Nov 02, 2000
Posts: 232
what happens as a result ?
does the number of viewable characters depend on what kind of font we use ?
suppose font is fixed, will we then see 40 characters ?
If it is not fixed, is it impossible to see 40 characters?
if the string above was made larger to have more than 40 characters, would it be viewable or we would have to scroll using arrow keys to see it ?
thanks
umang bhartia
Ranch Hand

Joined: Sep 29, 2000
Posts: 60
Yes sarim u r right, the number of characters visible in a text field depends on the font u r using. If u provide a text field for 40 characters then its not possible to view 40 characters even if u change the font. The number of columns is a measure of the size of the text line according to the particular font used for rendering the text. However for a fixed pitch fonts, the number of columns is equal to the number of characters in the text line. Hope i m clear
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TextField tf = new TextField("this is for",40);
 
Similar Threads
tricky textfields !
Fixed width Proportional width font?
TextArea and TextField Classes
proportional pitch font-fixed pitch font
Font resizing issue in PDF using IText Library