
SWT
文章平均质量分 51
freellf
这个作者很懒,什么都没留下…
展开
-
SWT之五:窗体展示
// TODO Auto-generated method stub Display display = new Display(); //获得该Display的一个Shell类的实例 Shell shell = new Shell(display); //为窗口设置大小 shell.setSize(200, 200); //为窗口设置标题栏文字 shel原创 2013-03-06 23:48:22 · 857 阅读 · 0 评论 -
SWT:分组框
// TODO Auto-generated method stub //创建一个面板类 //Composite composite = new Composite(shell, SWT.NONE); //面板类的样式 // SWT.NONE 没有边框 // SWT.BORDER 没有边框的面板 // SWT.NO_RADIO_GROUP 对单选按钮原创 2013-03-12 23:23:41 · 1298 阅读 · 0 评论 -
SWT之四:多窗体
import org.eclipse.swt.SWT;import org.eclipse.swt.events.SelectionEvent;import org.eclipse.swt.events.SelectionListener;import org.eclipse.swt.graphics.Image;import org.eclipse.swt.widgets.But原创 2013-03-03 14:38:53 · 1429 阅读 · 0 评论 -
SWT:FormLayout表格式布局
//创建FormLayout对象 FormLayout formLayout = new FormLayout(); formLayout.marginHeight = 5; //设置上下补白为5像素 formLayout.marginWidth = 5; //设置左右补白为5像素 shell.setLayout(formLayout); Button bt原创 2013-04-01 20:46:40 · 913 阅读 · 0 评论 -
SWT:StackLayout(堆栈式布局)
shell.setLayout(new GridLayout()); //创建放置文本框的面板 final Composite parent = new Composite(shell, SWT.NONE); //设置面板的布局数据 parent.setLayoutData(new GridData(GridData.FILL_BOTH)); //创建堆栈式布局原创 2013-04-01 21:07:19 · 2425 阅读 · 0 评论 -
SWT:自定义选项卡
public static void showCTabFolder(Shell shell) { //创建CTabFolder对象 final CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP); //创建带有关闭按钮的选项卡 //final CTabFolder tabFolder = new CTabFolde原创 2013-03-19 23:28:58 · 1578 阅读 · 0 评论 -
SWT:仿Eclipse选项卡
public static void showEcliplseTab(final Shell shell) { Image image = new Image(shell.getDisplay(), "D:\\Program Files\\eclipseRcp\\plugins\\org.eclipse.platform.source_4.2.1.v201209141800\\eclip原创 2013-03-20 22:42:57 · 1861 阅读 · 0 评论 -
SWT:分割窗口
public static void showSashForm(Shell shell) { //创建窗框对象,设置样式为水平排列 SashForm form = new SashForm(shell, SWT.HORIZONTAL | SWT.BORDER); //平滑外观 //SashForm form = new SashForm(shell, SWT.HORIZ原创 2013-03-23 16:35:14 · 1365 阅读 · 0 评论 -
SWT:自定义分分割窗口
public static void showCBanner(Shell shell) { //创建CBanner对象 CBanner banner = new CBanner(shell, SWT.BORDER); banner.setLayout(new FillLayout()); //创建3个面板,分别放置到左侧,右侧和下部 Composite l原创 2013-03-23 16:37:14 · 2541 阅读 · 0 评论 -
SWT:滚动面板
public static void showScrolled(Shell shell) { // 创建一个滚动面板对象 final ScrolledComposite sc = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); //创建一个普通面板 final Comp原创 2013-03-23 16:39:27 · 1594 阅读 · 0 评论 -
SWT:行列式布局
public static void showRowLayout(Shell shell) { RowLayout layout = new RowLayout(); //设置填充方式 layout.type = SWT.HORIZONTAL; //设置水平填充 默认为水平, //设置补白和间隔 默认状态为3 layout.marginLeft = 5;原创 2013-03-23 18:39:34 · 1075 阅读 · 0 评论 -
SWT:网格式布局
public static void showGridLayout(Shell shell) { GridLayout gridLayout = new GridLayout(); // 设置网格的列数 gridLayout.numColumns = 3; // 设置网格等宽 gridLayout.makeColumnsEqualWidth = true; //原创 2013-03-24 11:27:51 · 1362 阅读 · 0 评论 -
SWT:充满式布局
public static void showFillStyle(Shell shell) { // 两种定位方式 // 绝对定位 // button.setBounds(30, 20, 100, 50); // 托管定位 // shell.setLayout(Layout layout); // 常见的布局管理器 // FillLayout(充满式布局)原创 2013-03-23 17:09:45 · 1032 阅读 · 0 评论 -
SWT: 选项卡
// TODO Auto-generated method stub Display display = Display.getDefault(); Shell shell = new Shell(display); shell.setLayout(new FillLayout(SWT.VERTICAL)); //创建TabFolder对象 //一个选项卡文件原创 2013-03-12 23:25:23 · 1438 阅读 · 0 评论 -
SWT之三:ShellStyle
import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Shell;import org.eclipse.swt.SWT;public class ShellStyle { /** * @param args */ public static void main(String[] args)原创 2013-02-28 23:26:24 · 677 阅读 · 0 评论 -
SWT之六:普通按钮
普通按钮:SWT.PUSH Button bt1 = new Button(shell, SWT.PUSH | SWT.LEFT); //设置文本 bt1.setText("SWT.LEFT"); //设置悬浮提示 bt1.setToolTipText("SWT.LEFT"); Button bt2 = new Button(shell, SWT.PUS原创 2013-03-06 23:50:02 · 692 阅读 · 0 评论 -
SWT:切换按钮
public static void showToggleButton(Shell shell) { Button bt1 = new Button(shell, SWT.TOGGLE | SWT.LEFT); bt1.setText("SWT.LEFT"); bt1.setToolTipText("SWT.LEFT"); Button bt2 = new Bu原创 2013-03-10 12:52:22 · 673 阅读 · 0 评论 -
SWT:多选按钮
public static void showCheckButton(Shell shell) { //获得多选框是否选中,通常是放在数组中,利用循环判断是否被选中 //这是第一组单选按钮 Group group1 = new Group(shell, SWT.SHADOW_ETCHED_OUT); group1.setLayout(new FillLayout(SWT原创 2013-03-10 15:51:51 · 1357 阅读 · 0 评论 -
SWT:单选按钮
/** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Display display = Display.getDefault(); Shell shell = new Shell(display); shell.set原创 2013-03-10 13:59:16 · 3809 阅读 · 0 评论 -
SWT:多选按钮应用
public static void sample(Shell shell) { //定义Shell的布局 RowLayout layout = new RowLayout(SWT.VERTICAL); layout.marginWidth = 0; shell.setLayout(layout); final Group group = new Grou原创 2013-03-10 16:39:29 · 975 阅读 · 0 评论 -
SWT:箭头按钮
public static void showArrowButton(Shell shell) { //箭头按钮是带有小箭头的按钮,创建时还要指定箭头的方向 //SWT.UP, SWT.DOWN, SWT.LEFT, SWT.RIGHT //若不指定方向,默认为SWT.UP Button bt1 = new Button(shell, SWT.ARROW | SWT.U原创 2013-03-10 13:27:21 · 1130 阅读 · 0 评论 -
SWT:文本框
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);原创 2013-03-11 23:30:53 · 928 阅读 · 0 评论 -
SWT:下拉组合框
public static void showCombo(Shell shell) { final Combo combo = new Combo(shell, SWT.SIMPLE); String[] items = new String[4]; for (int i = 0; i items[i] = "选项" + i; } combo.setItem原创 2013-03-11 23:48:08 · 1268 阅读 · 0 评论 -
SWT之一: HelloWorld
import org.eclipse.swt.SWT;import org.eclipse.swt.widgets.Button;import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Shell;public class HelloWorld { /** * @param ar原创 2013-02-28 22:39:07 · 501 阅读 · 0 评论 -
SWT之二: SHELLDEMO
import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Shell;import org.eclipse.swt.SWT;public class ShellDemo { /** * @param args */ public static void main(String[]原创 2013-02-28 22:52:19 · 459 阅读 · 0 评论 -
Eclipse开发经典教程之常用SWT组件
在介绍组件之前,有必要介绍一下Control类。Control类是一个抽象类,它是所有窗口组 件(即在Windows中能获得句柄的部件)的基类。Control类的继承关系Control类是为继承而设计的,所有窗口组件都继承于Control类,如图1所示。图1 Control类的继承关系Control的一个实例代表Windows中的一个窗口组件,它中有窗口名柄属性,但是在程序中转载 2013-06-17 02:53:15 · 1404 阅读 · 0 评论