Reputation: 26418
I am using org.eclipse.swt.widgets.Text
's type of Text field. I want to increase the length of the field. How would I do this?
Upvotes: 5
Views: 23663
Reputation: 22721
For each field, if your general layout manager is GridLayout, your textbox layout data will be GridData. Pass width and height into the GridData constructor and set it to the textbox (textbox.setLayoutData()), along with the properties about how you want the layout manager to manipulate the field.
Upvotes: 11
Reputation: 68962
Text inherits these methods from Control:
public void setSize(int width,int height)
public void setSize(Point size)
Upvotes: 1
Reputation: 1416
Since Text is a control, it inherits the method: Text.setSize(width, height)
. This lets you set the actual dimensions of the Text field. Change the width to be something larger. You might also want to keep the height the same by doing something like
textField.setSize(width, textField.getSize().y)
Upvotes: 4