Skip to content

Commit 697d856

Browse files
author
Andrew Lu
committed
8329559: Test javax/swing/JFrame/bug4419914.java failed because The End and Start buttons are not placed correctly and Tab focus does not move as expected
Backport-of: 7c1fad4fb6c387bbfb72b3f96b610e7cbc2ef312
1 parent 716621d commit 697d856

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/jdk/javax/swing/JFrame/bug4419914.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public static void main(String[] args) throws Exception {
4747
PassFailJFrame.builder()
4848
.title("Tab movement Instructions")
4949
.instructions(INSTRUCTIONS)
50-
.rows(12)
51-
.columns(42)
50+
.rows((int) INSTRUCTIONS.lines().count() + 2)
51+
.columns(48)
5252
.testUI(bug4419914::createTestUI)
5353
.build()
5454
.awaitAndCheck();
@@ -59,11 +59,12 @@ private static JFrame createTestUI() {
5959
frame.setFocusCycleRoot(true);
6060
frame.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
6161
frame.setLocale(Locale.ENGLISH);
62-
6362
frame.enableInputMethods(false);
64-
frame.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
65-
frame.setLocale(Locale.ENGLISH);
66-
frame.setLayout(new BorderLayout());
63+
64+
frame.getContentPane().setComponentOrientation(
65+
ComponentOrientation.RIGHT_TO_LEFT);
66+
frame.getContentPane().setLocale(Locale.ENGLISH);
67+
frame.getContentPane().setLayout(new BorderLayout());
6768
frame.add(new JButton("SOUTH"), BorderLayout.SOUTH);
6869
frame.add(new JButton("CENTER"), BorderLayout.CENTER);
6970
frame.add(new JButton("END"), BorderLayout.LINE_END);

0 commit comments

Comments
 (0)