SWT:文本框
来源:互联网 发布:mac版latex使用教程 编辑:程序博客网 时间:2024/06/05 06:57
public static void showText(Shell shell) {
final Text content = new Text(shell, SWT.WRAP | SWT.V_SCROLL);
content.setBounds(5, 5, 325, 200);
Button selectAll = new Button(shell, SWT.NONE);
selectAll.setText("全选");
selectAll.setBounds(5, 225, 75, 25);
selectAll.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// 选中所有文本
content.selectAll();
}
});
Button cancel = new Button(shell, SWT.NONE);
cancel.setText("取消全选");
cancel.setBounds(90, 225, 75, 25);
cancel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// 如果有选中的文本
if (content.getSelectionCount() > 0) {
content.clearSelection(); // 清楚选择
}
}
});
Button copy = new Button(shell, SWT.NONE);
copy.setText("复制");
copy.setBounds(175, 225, 75, 25);
copy.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e)
{
//复制到剪贴板
content.copy();
}
});
Button paste = new Button(shell, SWT.NONE);
paste.setText("粘贴");
paste.setBounds(260, 225, 75, 25);
paste.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e)
{
//将剪贴板的内容粘贴
content.paste();
}
});
}
- SWT文本框
- SWT:文本框
- Java SWT 文本框 垂直 居中
- swt中限制文本框接受的字符
- 监听SWT文本框只能输入数字
- java swt 控件一(文本框)
- Java界面 SWT基本组件——文本框(Text)
- SWT中当光标移开文本框时验证
- java SWT:限制数值输入的Text文本框通用组件
- SWT
- SWT
- swt
- swt
- swt
- swt
- swt
- SWT
- SWT
- Java基础班第八天笔记
- Android Out Of Memory(OOM) 的详细研究
- Ubuntu下 ssh : connect to host localhost port 22:Connection refused
- 第一次C程序设计上机报告
- NYOJ - A-B Problem
- SWT:文本框
- 测试从零开始(二)白盒测试
- 一些硬件设计经验
- 设计模式学习
- JAVA对象比较器 Comparator
- Homework2.2.java
- [android]一款手机真机屏幕同步抓取软件
- STL map, STL set之数据结构基础
- android学习笔记之JNI