SWT组件介绍
来源:互联网 发布:广州星知电子有限公司 编辑:程序博客网 时间:2024/05/17 02:40
- 介绍
本文介绍SWT中一些组件的使用方法。
- ScrolledComposite
[caption id="attachment_2688" align="aligncenter" width="188"] ScrolledComposite[/caption]
[codesyntax lang="java"]
/** * Copyright By suren. * You can get more information from my website: * http://surenpi.com */package org.suren.swt.test;import org.eclipse.swt.SWT;import org.eclipse.swt.custom.ScrolledComposite;import org.eclipse.swt.layout.FillLayout;import org.eclipse.swt.layout.RowLayout;import org.eclipse.swt.widgets.Button;import org.eclipse.swt.widgets.Composite;import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Shell;/** * @author suren * @date 2015年9月30日 下午4:57:34 */public class ScrolledTest{/** * @param args */public static void main(String[] args){Display display = new Display();Shell shell = new Shell(display);shell.setLayout(new FillLayout());shell.setSize(200, 100);ScrolledComposite scroll = new ScrolledComposite(shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);Composite composite = new Composite(scroll, SWT.NULL);composite.setLayout(new RowLayout());new Button(composite, SWT.PUSH).setText("one");new Button(composite, SWT.PUSH).setText("one");new Button(composite, SWT.PUSH).setText("one");new Button(composite, SWT.PUSH).setText("one");new Button(composite, SWT.PUSH).setText("one");new Button(composite, SWT.PUSH).setText("one");//下面两句必须有scroll.setContent(composite);composite.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));shell.open();while(!shell.isDisposed()){if(!display.readAndDispatch()){display.sleep();}}display.dispose();}}
[/codesyntax]
查看原文:http://surenpi.com/2015/09/30/swt%e7%bb%84%e4%bb%b6%e4%bb%8b%e7%bb%8d/
0 0
- SWT组件介绍
- 扩展SWT组件问题
- SWT组件常用样式
- SWT常用组件
- 其他SWT组件
- SWT JFace 常用组件
- SWT常用组件
- SWT常用组件
- SWT常用组件
- SWT常用组件
- SWT/JFace常用组件
- SWT中的常用组件
- SWT常用组件
- SWT常用组件
- swt视图组件
- SWT常用组件
- SWT常用组件
- SWT/JFace 介绍
- 诡异的Qt eventFilter
- 获取指定格式时间戳(JSON注入)
- 浅谈网络编程的入门
- IOS 3Dtouch
- hdu 1542(扫描线)
- SWT组件介绍
- 编程实现用户名和密码自动生成【可以自己指定长度】
- 如何在win7下装ubuntu(硬盘版安装)
- JAVA 变量、数据类型、运算符
- 9月英语小总结
- 1240:Asteroids!
- Java笔记---String类
- 观后感 --《当幸福来敲门》和《赢在中国》
- 【FAQ】如何根据commit id找到对应节点所属的分支和标签?