• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Text field

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


Simply use

txt.setPreferredSize(-1,200);
where txt is Textbox initialised first!
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic