隨筆 - 303  文章 - 883  trackbacks - 0
          <2007年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          歡迎光臨! 
          閑聊 QQ:1074961813

          隨筆分類(357)

          我管理的群

          公共blog

          • n維空間
          • Email : java3d@126.com 群 : 12999758

          參與管理的論壇

          好友的blog

          我的其他blog

          朋友的網站

          搜索

          •  

          最新評論

          大家好我是尋覓;
          介紹個東西--SWT 給大家,不知道大家玩過沒?
          SWT性能遠遠勝過AWT和SWING,在Eclipse下的Designer比JB強得多,綜合起來比C#還強。

          Designer for Eclipse3.2.2
          http://downloads.instantiations.com/Designer/continuous/latest/Designer_v6.3.1_for_Eclipse3.2.zip
          如果該地址無法下載,請到官方網站下載

          環境配置參照:
          http://www.aygfsteel.com/lusm/archive/2007/06/22/125866.html

          包下載
          ttp://download.eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/download.php?dropFile=swt-3.2.2-win32-win32-x86.zip

          例子在線
          http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/CatalogSWT-JFace-Eclipse.htm

          例子下載
          http://download.eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/download.php?dropFile=eclipse-examples-3.2.2-win32.zip

          給大家兩個例子

          import org.eclipse.swt.SWT;
          import org.eclipse.swt.events.SelectionAdapter;
          import org.eclipse.swt.events.SelectionEvent;
          import org.eclipse.swt.widgets.Button;
          import org.eclipse.swt.widgets.Display;
          import org.eclipse.swt.widgets.Shell;
          import org.eclipse.swt.widgets.Text;
          import com.swtdesigner.SWTResourceManager;


          public class Myapp1 {

              
          private static Text text;
              
          /**
               * Launch the application
               * 
          @param args
               
          */

              
          public static void main(String[] args) {
                  
          final Display display = Display.getDefault();
                  
          final Shell shell = new Shell();
                  shell.setImage(SWTResourceManager.getImage(Myapp1.
          class"/jmapps/images/iconQuery.gif"));
                  shell.setRegion(
          null);
                  
                  shell.setSize(
          375239);
                  shell.setText(
          "新玩兒");
                  
          //

                  shell.open();

                  
          final Button button = new Button(shell, SWT.NONE);
                  shell.setDefaultButton(button);
                  button.setImage(SWTResourceManager.getImage(Myapp1.
          class"/jmapps/images/audio.gif"));
                  button.addSelectionListener(
          new SelectionAdapter() {
                      
          public void widgetSelected(SelectionEvent e) {
                      text.setText(
          "當然是沒問題咯。");
                      }

                  }
          );
                  button.setText(
          "確定");
                  button.setBounds(
          611449236);

                  text 
          = new Text(shell, SWT.BORDER);
                  text.setText(
          "Java寫GUI不行?");
                  text.setFont(SWTResourceManager.getFont(
          ""20, SWT.NONE));
                  text.setBackground(SWTResourceManager.getColor(
          0128192));
                  text.setBounds(
          495026936);

                  
          final Button button_1 = new Button(shell, SWT.NONE);
                  button_1.addSelectionListener(
          new SelectionAdapter() {
                      
          public void widgetSelected(SelectionEvent e) {
                     text.setText(
          "Java寫GUI不行?");
                      }

                  }
          );
                  button_1.setImage(SWTResourceManager.getImage(Myapp1.
          class"/jmapps/images/audio-disabled.gif"));
                  button_1.setText(
          " 重來");
                  button_1.setBounds(
          2141449236);
                  shell.layout();
                  
          while (!shell.isDisposed()) {
                      
          if (!display.readAndDispatch())
                          display.sleep();
                  }

              }


          }


          上面那個我寫著玩的試試而已






          地震讓大伙知道:居安思危,才是生存之道。
          posted on 2007-06-25 15:16 小尋 閱讀(1531) 評論(0)  編輯  收藏 所屬分類: j2se/j2ee/j2me
          主站蜘蛛池模板: SHOW| 荆门市| 台前县| 盘山县| 宁蒗| 华容县| 霍州市| 古交市| 广丰县| 那曲县| 盐亭县| 名山县| 卢氏县| 谷城县| 乌兰浩特市| 镇坪县| 修武县| 休宁县| 拉萨市| 孟津县| 湟源县| 湖口县| 大理市| 陈巴尔虎旗| 瓦房店市| 青川县| 浪卡子县| 吉林省| 乐平市| 沁阳市| 邵阳市| 太保市| 乌鲁木齐县| 双桥区| 赤水市| 三门峡市| 广南县| 长垣县| 吉安市| 兴业县| 永修县|