⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cardlayouttest.java

📁 JAVA SE6 全方位学习 朱仲杰 编著 机械工业出版社出版
💻 JAVA
字号:
import java.awt.*;import java.awt.event.*;public class CardLayoutTest implements ActionListener{	Frame f;	CardLayout card;	public static void main(String argv[])	{		new CardLayoutTest();	}	public CardLayoutTest()	{		f = new Frame("CardLayout test");		Button b1 = new Button("One");	        Button b2 = new Button("Two");	        Button b3 = new Button("Three");		b1.addActionListener(this);		b2.addActionListener(this);		b3.addActionListener(this);		card = new CardLayout();		f.setLayout(card);		f.add(b1, "1");		f.add(b2, "2");		f.add(b3, "3");		f.pack();		f.setVisible(true);	}	public void actionPerformed(ActionEvent e)	{		card.next(f);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -