From 7c1fad4fb6c387bbfb72b3f96b610e7cbc2ef312 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Fri, 3 May 2024 05:11:52 +0000 Subject: [PATCH] 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 Reviewed-by: abhiscxk, honkar, dnguyen --- test/jdk/javax/swing/JFrame/bug4419914.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/jdk/javax/swing/JFrame/bug4419914.java b/test/jdk/javax/swing/JFrame/bug4419914.java index 5e15d3c8f91..4574b1ac3d6 100644 --- a/test/jdk/javax/swing/JFrame/bug4419914.java +++ b/test/jdk/javax/swing/JFrame/bug4419914.java @@ -53,8 +53,8 @@ public class bug4419914 { PassFailJFrame.builder() .title("Tab movement Instructions") .instructions(INSTRUCTIONS) - .rows(12) - .columns(42) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(48) .testUI(bug4419914::createTestUI) .build() .awaitAndCheck(); @@ -65,11 +65,12 @@ public class bug4419914 { frame.setFocusCycleRoot(true); frame.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); frame.setLocale(Locale.ENGLISH); - frame.enableInputMethods(false); - frame.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); - frame.setLocale(Locale.ENGLISH); - frame.setLayout(new BorderLayout()); + + frame.getContentPane().setComponentOrientation( + ComponentOrientation.RIGHT_TO_LEFT); + frame.getContentPane().setLocale(Locale.ENGLISH); + frame.getContentPane().setLayout(new BorderLayout()); frame.add(new JButton("SOUTH"), BorderLayout.SOUTH); frame.add(new JButton("CENTER"), BorderLayout.CENTER); frame.add(new JButton("END"), BorderLayout.LINE_END);