zoukankan      html  css  js  c++  java
  • SWT(一)一个最简单的SWT程序示例


    public class Test{

     private Shell sShell = null; 

     
     /**
      * This method initializes sShell
      */
     private void createSShell() {
     
      sShell = new Shell();
      sShell.setLayout(gridLayout7);
      sShell.setSize(new Point(276, 195));
      sShell.setText("Shell");
      sShell.setLayout(gridLayout);
      sShell.setSize(new Point(341, 205));

      Label cLabel = new Label(sShell, SWT.NONE);
      cLabel.setText("Test a label");
     }
     
     public void Run()
     {
           try {
                createSShell();
            
                Display display = this.sShell.getDisplay();
                this.sShell.open();
                while (!this.sShell.isDisposed()) {             
                    if (!display.readAndDispatch())
                        display.sleep();
                }
               
                sShell.dispose();
                display.dispose();
            } catch (Exception e) {
                e.printStackTrace();
            }
     }
     
     public static void main(String args[]) {
      new Test().Run();
        }

    }

  • 相关阅读:
    vue基础知识
    制作离线yum源
    mysql字符集
    confluence 容器版 搭建部署
    iptables和ipvs
    http状态码
    运维相关网站博客集合
    搭建nexus私有maven私服
    MySQL 常见错误代码说明
    nc(瑞士军刀)
  • 原文地址:https://www.cnblogs.com/huqingyu/p/580070.html
Copyright © 2011-2022 走看看