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

📄 fahrenheitslider.java

📁 Java程序设计(美) David D. Riley著 机械工业出版社 书籍配套 代码
💻 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 + -