tags:

views:

230

answers:

3

I am using org.eclipse.swt.widgets.Text's type of Text field but i want to increase length of the field. how to do this.

+1  A: 

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)

bkritzer
+1  A: 

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/widgets/Text.html

Text inherits these methods from Control:

public void setSize(int width,int height)
public void setSize(Point size)
stacker
+1  A: 

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.

Chris Dennett