Search in sources :

Example 1 with SynthSliderUI

use of javax.swing.plaf.synth.SynthSliderUI in project jdk8u_jdk by JetBrains.

the class bug6923305 method main.

public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new SynthLookAndFeel());
    SwingUtilities.invokeAndWait(new Runnable() {

        public void run() {
            JSlider slider = new JSlider();
            slider.setUI(new SynthSliderUI(slider) {

                @Override
                protected void paintTrack(SynthContext context, Graphics g, Rectangle trackBounds) {
                    throw new RuntimeException("Test failed: the SynthSliderUI.paintTrack was invoked");
                }
            });
            slider.setPaintTrack(false);
            slider.setSize(slider.getPreferredSize());
            BufferedImage bufferedImage = new BufferedImage(slider.getWidth(), slider.getHeight(), BufferedImage.TYPE_INT_ARGB);
            slider.paint(bufferedImage.getGraphics());
        }
    });
}
Also used : SynthLookAndFeel(javax.swing.plaf.synth.SynthLookAndFeel) SynthSliderUI(javax.swing.plaf.synth.SynthSliderUI) BufferedImage(java.awt.image.BufferedImage) SynthContext(javax.swing.plaf.synth.SynthContext)

Aggregations

BufferedImage (java.awt.image.BufferedImage)1 SynthContext (javax.swing.plaf.synth.SynthContext)1 SynthLookAndFeel (javax.swing.plaf.synth.SynthLookAndFeel)1 SynthSliderUI (javax.swing.plaf.synth.SynthSliderUI)1