get JSlider's input and changes
问题 I need to use JSlider with getting input live, meaning that it will return an input without pressing any button. I have this piece of code for the slider: JPanel panel = new JPanel(); JSlider js = new JSlider(JSlider.VERTICAL, 0, 20, 10); js.setMajorTickSpacing(2); js.setPaintTicks(true); Hashtable labelTable = new Hashtable(); labelTable.put(new Integer(js.getMinimum()), new JLabel("x0")); labelTable.put(new Integer((js.getMinimum() + js.getMaximum()) / 2), new JLabel("x1")); labelTable.put