printingslider.java

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

JAVA
20
字号
// Figure 8.43import javax.swing.event.ChangeEvent;public class PrintingSlider extends EventSlider {	/** 	post:	this slider object is constructed	 *				and  the orientation is horizontal	 *				and  getMaximum() == max	 *				and  getMinimum() == min	 *				and  getValue() == val 	 */ 	public PrintingSlider(int min, int max, int val)  {    	super(HORIZONTAL, min, max, val);    }	/**	post:	getValue() is output */	public void stateChanged(ChangeEvent e)   {        System.out.println( getValue() );	}}

⌨️ 快捷键说明

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