package demotest;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
/**
*
* @author mositure
* TEXT
*/
public class Test_five {
/**
* @param args
*/
public static void main(String[] args) {
//定义Display
Display display = new Display();
//创建窗口
Shell shell = new Shell(display,SWT.SHELL_TRIM);
shell.setSize(500, 400);
shell.setText("分组实列");
//设置窗口布局
// shell.setLayout(new FillLayout(SWT.VERTICAL));
final Text text = new Text(shell,SWT.NONE);
text.setBounds(10, 20, 450, 150);
//常用方法:
text.setTextLimit(100);//设置文本最大长度
text.setVisible(true);//设置文本是否可编辑
text.setOrientation(SWT.RIGHT_TO_LEFT);//设置文本输入方向 右到左
text.setEchoChar('*');//设置文本输入字符格式
text.setTabs(0);//设置输
SWT进阶版-TEXT操作
最新推荐文章于 2021-03-04 16:48:27 发布