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();
        }

    }

  • 相关阅读:
    mobileSelect学习
    使用qrcode生成二维码
    点点点右边有内容
    搜索框search
    input样式和修改
    art-template模板引擎高级使用
    Nodejs中的路径问题
    异步编程(回调函数,promise)
    在nodejs中操作数据库(MongoDB和MySQL为例)
    MongoDB数据库
  • 原文地址:https://www.cnblogs.com/huqingyu/p/580070.html
Copyright © 2011-2022 走看看