📄 driver.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 + -