Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sarim raza
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic