598N/A/*
2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
598N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
598N/A *
598N/A * This code is free software; you can redistribute it and/or modify it
598N/A * under the terms of the GNU General Public License version 2 only, as
598N/A * published by the Free Software Foundation.
598N/A *
598N/A * This code is distributed in the hope that it will be useful, but WITHOUT
598N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
598N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
598N/A * version 2 for more details (a copy is included in the LICENSE file that
598N/A * accompanied this code).
598N/A *
598N/A * You should have received a copy of the GNU General Public License version
598N/A * 2 along with this work; if not, write to the Free Software Foundation,
598N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
598N/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.
598N/A */
598N/A
598N/A/*
598N/A * @test
598N/A * @bug 4252164
598N/A * @summary Tests rounded LineBorder for components
598N/A * @author Sergey Malenkov
598N/A * @run applet/manual=yesno Test4252164.html
598N/A */
598N/A
598N/Aimport java.awt.Color;
598N/Aimport java.awt.event.MouseWheelEvent;
598N/Aimport java.awt.event.MouseWheelListener;
598N/Aimport javax.swing.JApplet;
598N/Aimport javax.swing.JLabel;
598N/Aimport javax.swing.JPanel;
598N/Aimport javax.swing.border.LineBorder;
598N/A
598N/Apublic class Test4252164 extends JApplet implements MouseWheelListener {
598N/A private int thickness;
598N/A private JLabel rounded;
598N/A private JLabel straight;
598N/A
598N/A public void mouseWheelMoved(MouseWheelEvent event) {
598N/A update(event.getWheelRotation());
598N/A }
598N/A
598N/A public void init() {
598N/A add(createUI());
598N/A addMouseWheelListener(this);
598N/A }
598N/A
598N/A private JPanel createUI() {
598N/A this.rounded = new JLabel("ROUNDED"); // NON-NLS: the label for rounded border
598N/A this.straight = new JLabel("STRAIGHT"); // NON-NLS: the label for straight border
598N/A
598N/A JPanel panel = new JPanel();
598N/A panel.add(this.rounded);
598N/A panel.add(this.straight);
598N/A
598N/A update(10);
598N/A
598N/A return panel;
598N/A }
598N/A
598N/A private void update(int thickness) {
598N/A this.thickness += thickness;
598N/A
598N/A this.rounded.setBorder(new LineBorder(Color.RED, this.thickness, true));
598N/A this.straight.setBorder(new LineBorder(Color.RED, this.thickness, false));
598N/A }
598N/A}