隨筆 - 64  文章 - 9  trackbacks - 0
          <2009年3月>
          22232425262728
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          常用鏈接

          留言簿(6)

          我參與的團隊

          隨筆分類(88)

          隨筆檔案(92)

          文章分類(142)

          文章檔案(182)

          天基成員

          學習園

          我的海角

          搜索

          •  

          積分與排名

          • 積分 - 183429
          • 排名 - 319

          最新評論

          import java.awt.*;
          import java.awt.event.*;
          class Test{
              public static void main(String [] args){
                  Frame f=new Frame("變換");
                  CardLayout c1=new CardLayout();
                  f.setLayout(c1);
                  Button b []=new Button[4];
                  for(int i=0;i<4;i++){
                      b[i]=new Button("第"+i+"頁");
                      f.add(b[i],"page"+i);
                  }
                  b[0].setBackground(Color.red);
                  b[1].setBackground(Color.blue);
                  b[2].setBackground(Color.cyan);
                  b[3].setBackground(Color.green);
                  f.pack();
                  f.setVisible(true);
                  while(true){
                      try{
                          Thread.sleep(50);
                      }
                      catch (InterruptedException e){
                          e.printStackTrace();
                      }
                      c1.next(f);
                  }
              }
          }
          posted on 2009-03-23 09:26 鵬凌 閱讀(284) 評論(0)  編輯  收藏 所屬分類: Windowsjava
          主站蜘蛛池模板: 九龙坡区| 聂拉木县| 普宁市| 安溪县| 枣庄市| 澄城县| 凉城县| 重庆市| 宜宾县| 汕尾市| 郸城县| 台南市| 原平市| 巴林左旗| 建平县| 孙吴县| 太仆寺旗| 顺平县| 谢通门县| 连州市| 柳林县| 镇远县| 沂南县| 阜新| 宜州市| 定襄县| 宝丰县| 阿克| 祁门县| 遂宁市| 曲阳县| 神农架林区| 平潭县| 遵义县| 苏尼特右旗| 巴东县| 修文县| 大竹县| 奉节县| 贺州市| 周口市|