简体   繁体   English

增加“文本”字段的大小

[英]Increasing the size of the Text field

I am using org.eclipse.swt.widgets.Text 's type of Text field. 我正在使用org.eclipse.swt.widgets.Text的Text字段类型。 I want to increase the length of the field. 我想增加场地的长度。 How would I do this? 我该怎么做?

For each field, if your general layout manager is GridLayout, your textbox layout data will be GridData. 对于每个字段,如果您的常规布局管理器是GridLayout,则您的文本框布局数据将是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. 将宽度和高度传递到GridData构造函数并将其设置为文本框(textbox.setLayoutData()),以及有关布局管理器如何操作字段的属性。

Since Text is a control, it inherits the method: Text.setSize(width, height) . 由于Text是一个控件,它继承了方法: 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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 文件大小增加,但未写入文本 - File Size Increasing But Text Not Being Written 增加显示HTML文本的JTextPane的字体大小 - Increasing the font size of a JTextPane that displays HTML text 底部导航栏:文本大小在按下时增加? - Bottom Navigation Bar: Text size is increasing on pressing? 如何自动滚动文本区域而不增加其大小 - how to auto scroll a text area without increasing its size 可扩展列表视图列表的大小没有增加以匹配Android中的文本长度 - Expandable List view lists not increasing in size to match length of text in Android 如何通过在android *中增加布局或textView文本大小来放大/缩小? - How to zoom in/zoom out by increasing a layout or textView text size in **android**? Autosize = uniform 只缩小文本以适应,不增加大小 - Autosize = uniform only shrinks text to fit, not increasing size 面板上文本字段的大小和位置 - size and location of Text Field on the Panel iText限制文本字段中的文本大小 - iText Limiting Text Size in a Text Field JavaFX:如何在不增加容器(Label,Button)大小的情况下增加文本大小? - JavaFX: How to increase text size without increasing container (Label, Button) size?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM