posts - 5,  comments - 0,  trackbacks - 0
          import org.eclipse.swt.SWT;
          import org.eclipse.swt.widgets.Display;
          import org.eclipse.swt.widgets.Label;
          import org.eclipse.swt.widgets.Shell;
          import org.eclipse.swt.widgets.Text;


          public class TextTest {

              private static Text dingNiDeText_1;
              private static Text dingNiDeText;
              private static Text text_6;
              private static Text text_5;
              private static Text text_4;
              private static Text text_3;
              private static Text text_2;
              private static Text text_1;
              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.setSize(502, 336);
                  shell.setText("SWT Application");
                  //

                  shell.open();

                  text = new Text(shell, SWT.BORDER);//SWT.BORDER
                  text.setText("123");
                  text.setBounds(237, 24, 80, 25);

                  text_1 = new Text(shell, SWT.CENTER);//居中
                  text_1.setText("123");
                  text_1.setBounds(237, 57, 80, 25);

                  final Label swtNoneLabel = new Label(shell, SWT.NONE);
                  swtNoneLabel.setText("swt none");
                  swtNoneLabel.setBounds(74, 27, 48, 12);

                  final Label label_1 = new Label(shell, SWT.NONE);
                  label_1.setText("文字樣式:居中");
                  label_1.setBounds(74, 57, 80, 12);

                  text_2 = new Text(shell, SWT.RIGHT);//右對齊
                  text_2.setText("123");
                  text_2.setBounds(237, 88, 80, 25);

                  text_3 = new Text(shell, SWT.MULTI);
                  text_3.setText("ding ni de fei fei");//多行 輸入 需要回車
                  text_3.setBounds(237, 119, 80, 25);

                  text_4 = new Text(shell, SWT.WRAP);//多行 輸入 不需要回車
                  text_4.setText("ding ni de fei fei");
                  text_4.setBounds(237, 150, 80, 25);

                  text_5 = new Text(shell, SWT.PASSWORD);//密碼
                  text_5.setText("123");
                  text_5.setBounds(237, 181, 80, 25);

                  text_6 = new Text(shell, SWT.READ_ONLY);//只讀
                  text_6.setText("123");
                  text_6.setBounds(237, 212, 80, 25);

                  dingNiDeText = new Text(shell,SWT.V_SCROLL);//垂直滾動條
                  dingNiDeText.setText("ding ni de fei fei");
                  dingNiDeText.setBounds(237, 236, 80, 25);

                  dingNiDeText_1 = new Text(shell, SWT.H_SCROLL);//水平滾動條
                  dingNiDeText_1.setText("ding ni de fei fei");
                  dingNiDeText_1.setBounds(237, 274, 80, 25);
                  shell.layout();
                  while (!shell.isDisposed()) {
                      if (!display.readAndDispatch())
                          display.sleep();
                  }
              }

          }


          posted on 2008-03-31 07:11 hakuci 閱讀(421) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2008年3月>
          2425262728291
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          常用鏈接

          留言簿(1)

          隨筆檔案(5)

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 通江县| 明光市| 汪清县| 萨嘎县| 砚山县| 亚东县| 新闻| 庆云县| 景洪市| 嘉鱼县| 金阳县| 白玉县| 和田县| 宜宾市| 巨野县| 芜湖市| 安国市| 长宁县| 利辛县| 青海省| 尼木县| 洪江市| 阜城县| 衡南县| 阳高县| 汕头市| 巴里| 雷波县| 伊川县| 周至县| 安徽省| 临澧县| 太白县| 张掖市| 余干县| 西华县| 揭西县| 黄梅县| 利津县| 五大连池市| 五台县|