1623N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1623N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1623N/A *
1623N/A * This code is free software; you can redistribute it and/or modify it
1623N/A * under the terms of the GNU General Public License version 2 only, as
1623N/A * published by the Free Software Foundation.
1623N/A *
1623N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1623N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1623N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1623N/A * version 2 for more details (a copy is included in the LICENSE file that
1623N/A * accompanied this code).
1623N/A *
1623N/A * You should have received a copy of the GNU General Public License version
1623N/A * 2 along with this work; if not, write to the Free Software Foundation,
1623N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1623N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
1623N/A */
1623N/A
1623N/A/* @test
1623N/A * @bug 6579827
1623N/A * @summary vista : JSlider on JColorchooser is not properly render or can't be seen completely
1623N/A * @author Pavel Porvatov
1623N/A @run main bug6579827
1623N/A */
1623N/A
1623N/Aimport sun.awt.OSInfo;
1623N/A
1623N/Aimport javax.swing.*;
1623N/Aimport java.awt.*;
1623N/A
1623N/Apublic class bug6579827 {
1623N/A public static void main(String[] args) throws Exception {
1623N/A if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS ||
1623N/A OSInfo.getWindowsVersion() != OSInfo.WINDOWS_VISTA) {
1623N/A System.out.println("This test is only for Windows Vista. Skipped.");
1623N/A
1623N/A return;
1623N/A }
1623N/A
1623N/A SwingUtilities.invokeLater(new Runnable() {
1623N/A public void run() {
1623N/A try {
1623N/A UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
1623N/A } catch (Exception e) {
1623N/A e.printStackTrace();
1623N/A
1623N/A throw new RuntimeException(e);
1623N/A }
1623N/A
1623N/A JSlider slider = new JSlider(JSlider.VERTICAL, 0, 100, 0);
1623N/A
1623N/A Dimension prefferdSize = slider.getPreferredSize();
1623N/A
1623N/A slider.setPaintTrack(false);
1623N/A slider.putClientProperty("Slider.paintThumbArrowShape", Boolean.TRUE);
1623N/A
1623N/A if (prefferdSize.equals(slider.getPreferredSize())) {
1623N/A throw new RuntimeException();
1623N/A }
1623N/A }
1623N/A });
1623N/A }
1623N/A}