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

📄 card.java

📁 nanjing university cs 的java课件。 对新手很有用。付课件中源码。
💻 JAVA
字号:
import java.awt.*;

public class Card extends Frame{
	public Card() throws Exception{
		CardLayout l = new CardLayout();
		this.setLayout(l);
		//this.setLayout(new GridLayout(2,2));
		//this.setLayout(new GridLayout(2,2,10,5));
		add(new Button("1"), "First");
		add(new Button("2"), "Second");
		add(new Button("3"), "Third");
		add(new Button("4"), "Fourth");
		add(new Button("5"), "Fifth");
		add(new Button("6"), "Sixth");
		this.setSize(400,400);
		this.setVisible(true);//1
		Thread.sleep(1000);
		l.next(this);//2
		Thread.sleep(1000);
		l.next(this);//3
		Thread.sleep(1000);
		l.show(this, "Fifth");//5
		Thread.sleep(1000);
		l.next(this);//6
		Thread.sleep(1000);
		l.previous(this);//5
		Thread.sleep(1000);
		l.show(this, "Second");//2
		Thread.sleep(1000);
		l.last(this);//6
	}
	
	public static void main(String[] args) throws Exception{
		Card s = new  Card();
	}
}

⌨️ 快捷键说明

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