Skip to content

Commit c7c53d0

Browse files
committed
8258554: javax/swing/JTable/4235420/bug4235420.java fails in GTK L&F
Reviewed-by: serb
1 parent c50b464 commit c7c53d0

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

test/jdk/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@ javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 802462
731731
# The next test below is an intermittent failure
732732
javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all
733733
javax/swing/JColorChooser/Test6827032.java 8197825 windows-all
734-
javax/swing/JTable/4235420/bug4235420.java 8079127 generic-all
735734
javax/swing/JSplitPane/4201995/bug4201995.java 8079127 generic-all
736735
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
737736
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all

test/jdk/javax/swing/JTable/4235420/bug4235420.java

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,34 @@
3737
public class bug4235420 {
3838

3939
public static void main(String[] argv) throws Exception {
40-
if ("Nimbus".equals(UIManager.getLookAndFeel().getName())) {
41-
System.out.println("The test is skipped for Nimbus");
42-
43-
return;
44-
}
40+
for (UIManager.LookAndFeelInfo LF :
41+
UIManager.getInstalledLookAndFeels()) {
42+
try {
43+
UIManager.setLookAndFeel(LF.getClassName());
44+
} catch (UnsupportedLookAndFeelException ignored) {
45+
System.out.println("Unsupported L&F: " + LF.getClassName());
46+
} catch (ClassNotFoundException | InstantiationException
47+
| IllegalAccessException e) {
48+
throw new RuntimeException(e);
49+
}
50+
System.out.println("Testing L&F: " + LF.getClassName());
4551

46-
SwingUtilities.invokeAndWait(new Runnable() {
47-
@Override
48-
public void run() {
49-
Table table = new Table();
52+
if ("Nimbus".equals(UIManager.getLookAndFeel().getName()) ||
53+
"GTK".equals(UIManager.getLookAndFeel().getName())) {
54+
System.out.println("The test is skipped for Nimbus and GTK");
5055

51-
table.test();
56+
continue;
5257
}
53-
});
58+
59+
SwingUtilities.invokeAndWait(new Runnable() {
60+
@Override
61+
public void run() {
62+
Table table = new Table();
63+
64+
table.test();
65+
}
66+
});
67+
}
5468
}
5569

5670
private static class Table extends JTable {

0 commit comments

Comments
 (0)