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

    }

  • 相关阅读:
    论抱怨
    GitHub开源的10个超棒后台管理面板
    RESTful API 最佳实践
    理解RESTful架构
    redis 数据类型详解 以及 redis适用场景场合
    redis的应用场景 为什么用redis
    composer install 出现的问题
    什么是反向代理
    电脑 DNS纪要
    ajax请求处理概要
  • 原文地址:https://www.cnblogs.com/huqingyu/p/580070.html
Copyright © 2011-2022 走看看