javax.swing.plaf.basic.BasicSliderUI Java Examples

The following examples show how to use javax.swing.plaf.basic.BasicSliderUI. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: bug6401380.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public bug6401380() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    slider = new JSlider();
    slider.setMajorTickSpacing(0);
    slider.setMaximum(50);
    slider.setMinorTickSpacing(10);
    slider.setPaintLabels(true);
    slider.setPaintTicks(true);
    slider.setSnapToTicks(true);

    // MetalSliderUI overrides scrollDueToClickInTrack() method
    // so this test doens't work for Metal
    slider.setUI(new BasicSliderUI(slider));

    add(slider);
    setSize(200, 200);
}
 
Example #2
Source File: ViewUtils.java    From GIFKR with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void fixWinSliderUI(JSlider s) {

		if(System.getProperty("os.name").toLowerCase().contains("win")) {
			s.setUI(new BasicSliderUI(s){
				protected Dimension getThumbSize() {

					Dimension old = super.getThumbSize();

					return new Dimension(old.width*2, old.height);
				}
			});
		}
	}
 
Example #3
Source File: bug6848475.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #4
Source File: bug6848475.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #5
Source File: bug6848475.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #6
Source File: bug6848475.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #7
Source File: bug6848475.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #8
Source File: bug6848475.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #9
Source File: bug6848475.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #10
Source File: bug6848475.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #11
Source File: bug6848475.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #12
Source File: bug6848475.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #13
Source File: bug6848475.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #14
Source File: bug6848475.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #15
Source File: bug6848475.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Rectangle getThumbRectField() {
    try {
        SliderUI ui = slider.getUI();

        Field field = BasicSliderUI.class.getDeclaredField("thumbRect");

        field.setAccessible(true);

        return (Rectangle) field.get(ui);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #16
Source File: AquaSliderUI.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected BasicSliderUI.TrackListener createTrackListener(final JSlider s) {
    return new TrackListener();
}
 
Example #17
Source File: bug6794831.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void run() throws InterruptedException, InvocationTargetException {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
                try {
                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
                } catch (Exception e) {
                    fail(e.getMessage());
                }

                BufferedImage image = new BufferedImage(300, 200, BufferedImage.TYPE_INT_ARGB);

                // Test 1
                JSlider slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 2
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 3
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 4
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                countDownLatch.countDown();
            }
        }
    });

    if (countDownLatch.await(3000, TimeUnit.MILLISECONDS)) {
        System.out.println("bug6794831 passed");
    } else {
        fail("bug6794831 failed");
    }
}
 
Example #18
Source File: bug6794831.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void run() throws InterruptedException, InvocationTargetException {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
                try {
                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
                } catch (Exception e) {
                    fail(e.getMessage());
                }

                BufferedImage image = new BufferedImage(300, 200, BufferedImage.TYPE_INT_ARGB);

                // Test 1
                JSlider slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 2
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 3
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 4
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                countDownLatch.countDown();
            }
        }
    });

    if (countDownLatch.await(3000, TimeUnit.MILLISECONDS)) {
        System.out.println("bug6794831 passed");
    } else {
        fail("bug6794831 failed");
    }
}
 
Example #19
Source File: AquaSliderUI.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected BasicSliderUI.TrackListener createTrackListener(final JSlider s) {
    return new TrackListener();
}
 
Example #20
Source File: AquaSliderUI.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected BasicSliderUI.TrackListener createTrackListener(final JSlider s) {
    return new TrackListener();
}
 
Example #21
Source File: AquaSliderUI.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected BasicSliderUI.TrackListener createTrackListener(final JSlider s) {
    return new TrackListener();
}
 
Example #22
Source File: bug6794831.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void run() throws InterruptedException {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
                try {
                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
                } catch (Exception e) {
                    fail(e.getMessage());
                }

                BufferedImage image = new BufferedImage(300, 200, BufferedImage.TYPE_INT_ARGB);

                // Test 1
                JSlider slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 2
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 3
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 4
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                countDownLatch.countDown();
            }
        }
    });

    if (countDownLatch.await(3000, TimeUnit.MILLISECONDS)) {
        System.out.println("bug6794831 passed");
    } else {
        fail("bug6794831 failed");
    }
}
 
Example #23
Source File: bug6794831.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void run() throws InterruptedException {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
                try {
                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
                } catch (Exception e) {
                    fail(e.getMessage());
                }

                BufferedImage image = new BufferedImage(300, 200, BufferedImage.TYPE_INT_ARGB);

                // Test 1
                JSlider slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 2
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 3
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 4
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                countDownLatch.countDown();
            }
        }
    });

    if (countDownLatch.await(3000, TimeUnit.MILLISECONDS)) {
        System.out.println("bug6794831 passed");
    } else {
        fail("bug6794831 failed");
    }
}
 
Example #24
Source File: AquaSliderUI.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected BasicSliderUI.TrackListener createTrackListener(final JSlider s) {
    return new TrackListener();
}
 
Example #25
Source File: AquaSliderUI.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected BasicSliderUI.TrackListener createTrackListener(final JSlider s) {
    return new TrackListener();
}
 
Example #26
Source File: bug6794831.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void run() throws InterruptedException, InvocationTargetException {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
                try {
                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
                } catch (Exception e) {
                    fail(e.getMessage());
                }

                BufferedImage image = new BufferedImage(300, 200, BufferedImage.TYPE_INT_ARGB);

                // Test 1
                JSlider slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 2
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 3
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 4
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                countDownLatch.countDown();
            }
        }
    });

    if (countDownLatch.await(3000, TimeUnit.MILLISECONDS)) {
        System.out.println("bug6794831 passed");
    } else {
        fail("bug6794831 failed");
    }
}
 
Example #27
Source File: bug6794831.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void run() throws InterruptedException, InvocationTargetException {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
                try {
                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
                } catch (Exception e) {
                    fail(e.getMessage());
                }

                BufferedImage image = new BufferedImage(300, 200, BufferedImage.TYPE_INT_ARGB);

                // Test 1
                JSlider slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 2
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 3
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 4
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                countDownLatch.countDown();
            }
        }
    });

    if (countDownLatch.await(3000, TimeUnit.MILLISECONDS)) {
        System.out.println("bug6794831 passed");
    } else {
        fail("bug6794831 failed");
    }
}
 
Example #28
Source File: AquaSliderUI.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected BasicSliderUI.TrackListener createTrackListener(final JSlider s) {
    return new TrackListener();
}
 
Example #29
Source File: bug6794831.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void run() throws InterruptedException, InvocationTargetException {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
                try {
                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
                } catch (Exception e) {
                    fail(e.getMessage());
                }

                BufferedImage image = new BufferedImage(300, 200, BufferedImage.TYPE_INT_ARGB);

                // Test 1
                JSlider slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 2
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 3
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 4
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                countDownLatch.countDown();
            }
        }
    });

    if (countDownLatch.await(3000, TimeUnit.MILLISECONDS)) {
        System.out.println("bug6794831 passed");
    } else {
        fail("bug6794831 failed");
    }
}
 
Example #30
Source File: bug6794831.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void run() throws InterruptedException, InvocationTargetException {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) {
                try {
                    UIManager.setLookAndFeel(lookAndFeelInfo.getClassName());
                } catch (Exception e) {
                    fail(e.getMessage());
                }

                BufferedImage image = new BufferedImage(300, 200, BufferedImage.TYPE_INT_ARGB);

                // Test 1
                JSlider slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 2
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 3
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMajorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                // Test 4
                slider = new JSlider(0, Integer.MAX_VALUE - 1, 0);

                slider.setOrientation(JSlider.VERTICAL);
                slider.setMinorTickSpacing((Integer.MAX_VALUE - 1) / 4);
                slider.setPaintTicks(true);

                ((BasicSliderUI) slider.getUI()).paintTicks(image.getGraphics());

                countDownLatch.countDown();
            }
        }
    });

    if (countDownLatch.await(3000, TimeUnit.MILLISECONDS)) {
        System.out.println("bug6794831 passed");
    } else {
        fail("bug6794831 failed");
    }
}