随笔 - 64  文章 - 9  trackbacks - 0
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(6)

我参与的团队

随笔分类(88)

随笔档案(92)

文章分类(142)

文章档案(182)

天基成员

学习园

我的海角

搜索

  •  

积分与排名

  • 积分 - 178742
  • 排名 - 320

最新评论

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-09-24 11:08 鹏凌 阅读(963) 评论(0)  编辑  收藏 所属分类: Java --j2ee

只有注册用户登录后才能发表评论。


网站导航: