?? fahrenheitslider.java
字號:
// Figure 8.48import javax.swing.event.ChangeEvent;public class FahrenheitSlider extends EventSlider { private FahrenheitField theField; /** pre: f != null * post: theField == f * and getMinimum() == min and getMaximum() == max * and getValue() = val and orientation is HORIZONTAL * and theField == f */ public FahrenheitSlider(int min, int max, int val, FahrenheitField f) { super(HORIZONTAL, min, max, val); theField = f; } /** pre: theField != null * post: theField.intValue == intValue * and the postcondition of theField.actionPerformed(null) */ public void stateChanged(ChangeEvent e) { theField.setText("" + getValue()); theField.repaint(); theField.actionPerformed(null); //null is a dummy argument }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -