1. how to have jslider's track below the knob's image and how to fill colours in track on Slider's knob movement? stackoverflow.comHI All, i need to put jSlider's track below the knob's image and fill different colours in track on Slider's knob movement. Please explain with some code snippets. Thanks Jyoti |
2. JButton background color from slider stackoverflow.comI have a JPanel to allow the user to set the color of an object with these components:
|
3. JSlider knob color coderanch.comThis code should get you started. The knob is rectangle in this example but you should get the idea. import javax.swing.*; import java.awt.*; import javax.swing.plaf.basic.*; public class test extends JFrame { JSlider slider; Container c = getContentPane(); public test() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); slider = new JSlider(0,100); slider.setUI(new coloredThumbSliderUI(slider, Color.red)); slider.setMajorTickSpacing(10); slider.setMinorTickSpacing(5); slider.setPaintLabels(true); slider.setPaintTrack(true); slider.setSnapToTicks(true); slider.putClientProperty("JSlider.isFilled", Boolean.TRUE); c.add(slider); setSize(400,400); setVisible(true); } public static ... |
4. Problem in changing forground color of JSlider!! coderanch.com |
5. JSlider - Color Changer java-forums.org |
6. coloring the track of a JSlider forums.oracle.com |