1229N/A/*
2362N/A * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
1229N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1229N/A *
1229N/A * This code is free software; you can redistribute it and/or modify it
1229N/A * under the terms of the GNU General Public License version 2 only, as
1229N/A * published by the Free Software Foundation.
1229N/A *
1229N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1229N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1229N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1229N/A * version 2 for more details (a copy is included in the LICENSE file that
1229N/A * accompanied this code).
1229N/A *
1229N/A * You should have received a copy of the GNU General Public License version
1229N/A * 2 along with this work; if not, write to the Free Software Foundation,
1229N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1229N/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.
1229N/A */
1229N/A
1229N/A/* @test
1229N/A @bug 6741426
1229N/A @summary Tests reusing Nimbus borders across different components (JComboBox border set on a JTextField)
1229N/A @author Peter Zhelezniakov
1229N/A @run main Test6741426
1229N/A*/
1229N/A
1229N/Aimport com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
1229N/Aimport javax.swing.*;
1229N/Aimport java.awt.image.BufferedImage;
1229N/A
1229N/A
1229N/Apublic class Test6741426 implements Runnable {
1229N/A
1229N/A static final int WIDTH = 160;
1229N/A static final int HEIGHT = 80;
1229N/A
1229N/A @Override public void run() {
1229N/A JComboBox cb = new JComboBox();
1229N/A JTextField tf = new JTextField();
1229N/A tf.setBorder(cb.getBorder());
1229N/A BufferedImage img =
1229N/A new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_ARGB);
1229N/A tf.setSize(WIDTH, HEIGHT);
1229N/A tf.paint(img.getGraphics());
1229N/A }
1229N/A
1229N/A public static void main(String[] args) throws Exception {
1229N/A UIManager.setLookAndFeel(new NimbusLookAndFeel());
1229N/A SwingUtilities.invokeAndWait(new Test6741426());
1229N/A }
1229N/A}