jdk/test/javax/swing/JFileChooser/4252173/bug4252173.java
author xdono
Wed, 02 Jul 2008 12:55:45 -0700
changeset 715 f16baef3a20e
parent 453 145f4ac00bfd
permissions -rw-r--r--
6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
453
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
     1
/*
715
f16baef3a20e 6719955: Update copyright year
xdono
parents: 453
diff changeset
     2
 * Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
453
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
     4
 *
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
     7
 * published by the Free Software Foundation.
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
     8
 *
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    13
 * accompanied this code).
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    14
 *
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    18
 *
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    21
 * have any questions.
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    22
 */
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    23
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    24
/* @test
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    25
   @bug 4252173
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    26
   @summary Inability to reuse the HorizontalSliderThumbIcon
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    27
   @author Pavel Porvatov
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    28
   @run main bug4252173
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    29
*/
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    30
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    31
import javax.swing.*;
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    32
import javax.swing.plaf.metal.DefaultMetalTheme;
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    33
import javax.swing.plaf.metal.MetalLookAndFeel;
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    34
import java.awt.*;
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    35
import java.awt.image.BufferedImage;
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    36
import java.lang.reflect.InvocationTargetException;
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    37
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    38
public class bug4252173 {
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    39
    public static void main(String[] args) throws InvocationTargetException, InterruptedException {
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    40
        SwingUtilities.invokeAndWait(new Runnable() {
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    41
            public void run() {
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    42
                MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    43
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    44
                JComponent component = new JLabel();
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    45
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    46
                Icon horizontalThumbIcon = UIManager.getIcon("Slider.horizontalThumbIcon");
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    47
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    48
                Icon verticalThumbIcon = UIManager.getIcon("Slider.verticalThumbIcon");
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    49
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    50
                Graphics g = new BufferedImage(100, 100, BufferedImage.TYPE_4BYTE_ABGR).getGraphics();
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    51
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    52
                horizontalThumbIcon.paintIcon(component, g, 0, 0);
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    53
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    54
                verticalThumbIcon.paintIcon(component, g, 0, 0);
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    55
            }
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    56
        });
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    57
    }
145f4ac00bfd 4252173: Inability to reuse the HorizontalSliderThumbIcon
rupashka
parents:
diff changeset
    58
}