swt table控件的使用(shell)
来源:互联网 发布:玩客云官网抢购软件 编辑:程序博客网 时间:2024/04/26 19:01
package swt;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.TableItem;
public class She extends Shell {
private Table table;
private TableItem tm;
private TableItem tm_1;
private TableItem tm_2;
private Button button;
/**
* Launch the application.
* @param args
*/
public static void main(String args[]) {
try {
Display display = Display.getDefault();
She shell = new She(display);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the shell.
* @param display
*/
public She(Display display) {
super(display, SWT.SHELL_TRIM);
table = new Table(this, SWT.BORDER | SWT.FULL_SELECTION);
table.setBounds(10, 39, 414, 213);
table.setHeaderVisible(true);
table.setLinesVisible(true);
TableColumn t = new TableColumn(table, SWT.NONE);
t.setWidth(100);
t.setText("姓名");
TableColumn t_1 = new TableColumn(table, SWT.NONE);
t_1.setWidth(100);
t_1.setText("年龄 ");
TableColumn t_2 = new TableColumn(table, SWT.NONE);
t_2.setWidth(100);
t_2.setText("性别 ");
TableColumn t_3 = new TableColumn(table, SWT.NONE);
t_3.setWidth(100);
t_3.setText("身高");
button = new Button(this, SWT.NONE);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
tm = new TableItem(table, SWT.NONE);
tm.setText(new String[]{"张三","22","男","175cm"});
tm_1 = new TableItem(table, SWT.NONE);
tm_1.setText(new String[]{"李四","21","女","172cm"});
tm_2 = new TableItem(table, SWT.NONE);
tm_2.setText(new String[]{"王五","25","男","170cm"});
}
});
button.setBounds(146, 10, 80, 27);
button.setText("/u663E/u793A ");
createContents();
}
/**
* Create contents of the shell.
*/
protected void createContents() {
}
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
}
- swt table控件的使用(shell)
- SWT - Table的使用
- swt控件的使用
- swt table 使用小结
- eclipse SWT table 使用
- SWT/JFACE的table中加入控件 事件监听
- 在swt中使用table
- SWT:Tabfolder TabItem Table TableItem etc 的使用。
- SWT的SHELL样式
- SWT应用之:随机RGB颜色、ScrolledComposite控件的使用(二)————SWT Component(SWT组件)使用
- MFC Table控件的使用
- 自定义的SWT控件
- SWT的标签控件
- Webdnpro UI控件开发篇 Table控件使用五(Table的单元格使用不同的控件)
- 如何正确使用SWT控件
- SWT中comboViewer 控件使用
- swt table
- SWT..table
- 系出名门 Android(6) - 控件(View)之DatePicker, TimePicker, ToggleButton, EditText, ProgressBar, SeekBar, AutoCompleteTextView, MultiAuto
- JavaScript中使用正则匹配多条,且获取每条中的分组数据
- [算法] 从 Memcached 分布式应用看一致性哈希散列函数的选择
- Javascript实现把网页中table的内容导入到excel中的几种方法
- 现今我了解的一些分布式数据库或者文件系统
- swt table控件的使用(shell)
- Struts实现文件下载中文乱码解决方案
- Response.Charset="utf-8"与Response.Charset="gb2312"
- js 中 this的探讨
- Android使用XML-RPC实现blog客户端
- 更改与显示文字标签----android 2.2
- Cisco brocade SAN 常用命令
- 勤于动手操作 满分过CCNA认证
- Jquery调用Webservice传递Json数组