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

📄 wall.java

📁 一些JAVA的小程序
💻 JAVA
字号:
import java.awt.*;public class Wall implements PinBallTarget{	public Rectangle location;	public Wall (int x, int y, int width, int height)	{		location = new Rectangle(x, y, width, height);	}	public void moveTo (int x, int y)	{		location.setLocation(x, y);	}	public void paint (Graphics g)	{		g.setColor(Color.black);		g.fillRect(location.x, location.y, location.width, location.height);	}	public boolean intersects (PinBall aBall)	{       		return location.intersects(aBall.box());	}	public void hitBy (PinBall aBall)	{		if ((aBall.y() < location.y) ||		    (aBall.y() > (location.y + location.height)))		  aBall.reflectHorz();		else		  aBall.reflectVert();	}}

⌨️ 快捷键说明

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