c0c445f1fc13001c1d2fc692924e35ff

来自「java编写的一个坦克大战游戏」· 代码 · 共 39 行

TXT
39
字号
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class TankClient extends Frame {

	public void launchFrame()
	{
		this.setLocation(100,100);
		this.setTitle("Tank 大战");
		this.setSize(800,600);
		this.setBackground(Color.GREEN);//设置背景颜色
		this.addWindowListener(new WindowAdapter()
				{
					public void windowClosing(WindowEvent e) {
					   System.exit(0);
					}
				}
            );		
		this.setResizable(false);
		
		this.setVisible(true);
		
	}
	
	public void paint(Graphics g)
	{
		Color c=g.getColor();
		g.setColor(Color.RED);	
		g.fillOval(30,30,50,50);			
	}
	
	
	public static void main(String[] args) {
		TankClient tc=new TankClient();
		tc.launchFrame();
	}

}

⌨️ 快捷键说明

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