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

📄 e00c42f7b617001c1dc48a59085d713a

📁 java编写的一个坦克大战游戏
💻
字号:
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class MainArea extends Frame {

	public void launchFrame()
	{
	   this.setLocation(100,100);
	   this.setSize(500,500);
	   this.setVisible(true);
	   
	   this.addWindowListener(new WindowAdapter()
			  {
				public void windowClosing(WindowEvent e) {
				    System.exit(0);
				}
		          
		   
			  }
	   
	   );	
	}
	
	public void paint(Graphics g)
	{
		Color c=g.getColor();
		g.setColor(Color.RED);
		for(int i=0;i<19;i++)
		{
			int t=100+i*5;
			
			g.drawLine(t,100,t,200);
		}
		
		//g.drawLine(100,100,200,200);
		g.setColor(c);	
	}
	
	
	
	
	
	public static void main(String[] args) {
		MainArea ma=new MainArea();
		ma.launchFrame();
	}

}

⌨️ 快捷键说明

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