cakebutton.java

来自「Java程序设计(美) David D. Riley著 机械工业出版社 书籍配套」· Java 代码 · 共 26 行

JAVA
26
字号
// Figure 9.13import java.awt.event.ActionEvent;public class CakeButton extends EventButton  {	private Driver driver;	/**	pre:	d != null  <br>	 *	post:	getX() == x  and  getY() == y	 *			and  getWidth() == 250  and  getHeight() == 30	 *			and  getText() == "make and slice a new cake"	 *			and  driver == d  	 */   public CakeButton( int x, int y, Driver d)  {    	super("make and slice a new cake");		setBounds(x, y, 250, 30);        driver = d;   }	/** pre:	driver != null  <br>	 *	note:	the cutTheCake method from driver is performed. 	 */	public void actionPerformed( ActionEvent e )   {        driver.cutTheCake( );	}}

⌨️ 快捷键说明

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