• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to increase the TextField?

 
Dalin Mansour
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody:
I have this code and I want to increase the length of the text field
class CalcWindow extends Frame implements ActionListener
{
//Creates label, one text fields and a button.
Label temp = new Label("enter Fahrenheit temp");
TextField result = new TextField();
Button calculate = new Button("calculate");

String cTemp;
Any suggestions please to do that?
 
Knute Snortum
Sheriff
Posts: 3253
82
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using this constructor.
 
Dalin Mansour
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Knute.
I tried this code which set the columns of the TextField with name result to more columns:
result.setColumns(8);
It work and the length of the TextField increased.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!