Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text field

 
Debojit Nag
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Please give me a solution, if any, regarding text field size. According to the specs i have to make a text field for user input. Usually at the beginning it shows up a small rectangle and become larger as text become larger( if max char supports). I need a big( 5/6 lines) rectangle at the starting. How could i make this???

Regards
Debojit
 
sailesh sirari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


You can simply give the size on textField constuctor

TextField txt=new TextField("label","text",50,TextField.ANY);
keep changing that size until it satisfies ur needs.
 
Debojit Nag
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Yeah, thats true, but not in my case. This will show up the text field with by default height and then goes on increasing as no. of line increased.But I need bigger height at the beginning.

Debojit
 
sailesh sirari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


Simply use

txt.setPreferredSize(-1,200);
where txt is Textbox initialised first!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic