Increase text box size

I use the text field org.eclipse.swt.widgets.Text . I want to increase the length of the field. How can I do it?

+4
source share
3 answers

For each field, if your general layout manager is GridLayout, your text field layout data will be GridData. The width and height of the transfer in the GridData constructor and set it to a text field (textbox.setLayoutData ()) along with properties about how you want the layout manager to manipulate this field.

+7
source

Since Text is a control, it inherits a method: Text.setSize(width, height) . This allows you to set the actual size of the Text field. Change the width to be something big. You can also keep the height the same by doing something like

textField.setSize(width, textField.getSize().y)

+4
source

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

The text inherits these methods from Control:

 public void setSize(int width,int height) public void setSize(Point size) 
+1
source

Source: https://habr.com/ru/post/1302150/


All Articles