Skip to content

Commit 9393897

Browse files
committedJan 6, 2025
8346260: Test "javax/swing/JOptionPane/bug4174551.java" failed because the font size of message "Hi 24" is not set to 24 in Nimbus LookAndFeel
Reviewed-by: aivanov, dnguyen
1 parent e98f412 commit 9393897

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

‎src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDefaultLookup.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,9 @@
2525
package javax.swing.plaf.synth;
2626

2727
import sun.swing.DefaultLookup;
28+
2829
import javax.swing.JComponent;
30+
import javax.swing.UIManager;
2931
import javax.swing.plaf.ComponentUI;
3032

3133
/**
@@ -35,6 +37,12 @@
3537
*/
3638
class SynthDefaultLookup extends DefaultLookup {
3739
public Object getDefault(JComponent c, ComponentUI ui, String key) {
40+
if (ui instanceof SynthOptionPaneUI) {
41+
Object value = super.getDefault(c, ui, key);
42+
if (value != null) {
43+
return value;
44+
}
45+
}
3846
if (!(ui instanceof SynthUI)) {
3947
Object value = super.getDefault(c, ui, key);
4048
return value;

‎test/jdk/javax/swing/JOptionPane/bug4174551.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 4174551
26+
* @bug 4174551 8346260
2727
* @summary JOptionPane should allow custom buttons
2828
* @library /java/awt/regtesthelpers
2929
* @build PassFailJFrame

0 commit comments

Comments
 (0)
Please sign in to comment.