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

📄 ballworld.java

📁 一些JAVA的小程序
💻 JAVA
字号:
import java.awt.*;import javax.swing.*;public class BallWorld extends JFrame {	public static void main (String [ ] args) {		BallWorld world = new BallWorld (Color.red);		world.show();		world.run();		System.exit(0);	}	public static final int FrameWidth = 600;	public static final int FrameHeight = 400;	private BallWorldPanel panel;	private BallWorld (Color ballColor) {		setSize(FrameWidth, FrameHeight);		setTitle("Ball World");		panel = new BallWorldPanel(ballColor);		getContentPane().add(panel);	}	private void run () {		for (int i = 0; i < 2000; i++) {			panel.moveBall(FrameWidth-8, FrameHeight-35);			repaint();			try {				Thread.sleep(10);			} catch(InterruptedException e) { System.exit(0); }		}	}}

⌨️ 快捷键说明

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