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

📄 driver.java

📁 Java程序设计(美) David D. Riley著 机械工业出版社 书籍配套 代码
💻 JAVA
字号:
/**	COLLEGE toggle Program  (Figure 7.13) *	Author: David Riley */import java.awt.*;public class Driver extends ThreeButtons {	private ThreeButtonFrame window;	private Label sweatshirtMsg;	private boolean isAdded;	/**post:	window is constructed 	 *			and sweatshirtMsg.getText()=="COLLEGE"	 *			and sweatshirtMsg has been added to window誷 content pane	 *			and isAdded 	 */	public Driver()  {   		window = new ThreeButtonFrame( "Flashing Message Window" );		window.setLayout(null);		sweatshirtMsg = new Label( "COLLEGE" );		sweatshirtMsg.setBounds( 250, 200, 100, 30 );		window.add(sweatshirtMsg, 0);		isAdded = true;		window.repaint();	}		/**pre:	sweatshirtMsg!=null  and  window!=null 	 *	post:	(isAdded@pre  implies	 *				sweatshirtMsg is removed and  not isAdded)	 *			and  (not isAdded@pre  implies	 *				sweatshirtMsg is added and isAdded) 	 */	public void leftAction()   {		if ( isAdded )   {			window.remove( sweatshirtMsg );		} else {			window.add( sweatshirtMsg, 0 );		}		window.repaint();		isAdded = !isAdded;	}    	public void midAction()   {	}	public void rightAction()   {	}}

⌨️ 快捷键说明

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