10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6416920
27 * @summary Ensures that selected tab is painted properly in the scroll tab layout
28 * under WindowsLookAndFeel in Windows' "Windows XP" theme.
29 * @author Mikhail Lapshin
30 * @library ../../../../lib/testlibrary
31 * @build jdk.testlibrary.OSInfo
32 * @run main bug6416920
33 */
34
35 import javax.swing.plaf.basic.BasicTabbedPaneUI;
36 import javax.swing.JTabbedPane;
37 import javax.swing.SwingConstants;
38 import java.awt.Rectangle;
39 import java.awt.Insets;
40 import jdk.testlibrary.OSInfo;
41
42 public class bug6416920 extends BasicTabbedPaneUI {
43 public AccessibleTabbedPaneLayout layout = new AccessibleTabbedPaneLayout();
44
45 public static void main(String[] args) {
46
47 if(OSInfo.getOSType() != OSInfo.OSType.WINDOWS){
48 return;
49 }
50
51 bug6416920 test = new bug6416920();
52 test.layout.padSelectedTab(SwingConstants.TOP, 0);
53 if (test.rects[0].width < 0) {
54 throw new RuntimeException("A selected tab isn't painted properly " +
55 "in the scroll tab layout under WindowsLookAndFeel " +
56 "in Windows' \"Windows XP\" theme.");
57 }
58 }
59
60 public bug6416920() {
61 super();
62
63 // Set parameters for the padSelectedTab() method
64 selectedTabPadInsets = new Insets(0, 0, 0, 0);
65
66 tabPane = new JTabbedPane();
67 tabPane.setSize(100, 0);
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6416920
27 * @summary Ensures that selected tab is painted properly in the scroll tab layout
28 * under WindowsLookAndFeel in Windows' "Windows XP" theme.
29 * @author Mikhail Lapshin
30 * @library /test/lib
31 * @build jdk.test.lib.Platform
32 * @run main bug6416920
33 */
34
35 import javax.swing.plaf.basic.BasicTabbedPaneUI;
36 import javax.swing.JTabbedPane;
37 import javax.swing.SwingConstants;
38 import java.awt.Rectangle;
39 import java.awt.Insets;
40
41 import jdk.test.lib.Platform;
42
43 public class bug6416920 extends BasicTabbedPaneUI {
44 public AccessibleTabbedPaneLayout layout = new AccessibleTabbedPaneLayout();
45
46 public static void main(String[] args) {
47
48 if (!Platform.isWindows()) {
49 return;
50 }
51
52 bug6416920 test = new bug6416920();
53 test.layout.padSelectedTab(SwingConstants.TOP, 0);
54 if (test.rects[0].width < 0) {
55 throw new RuntimeException("A selected tab isn't painted properly " +
56 "in the scroll tab layout under WindowsLookAndFeel " +
57 "in Windows' \"Windows XP\" theme.");
58 }
59 }
60
61 public bug6416920() {
62 super();
63
64 // Set parameters for the padSelectedTab() method
65 selectedTabPadInsets = new Insets(0, 0, 0, 0);
66
67 tabPane = new JTabbedPane();
68 tabPane.setSize(100, 0);
|