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
This commit is contained in:
Prasanta Sadhukhan 2025-01-06 06:01:24 +00:00
parent e98f412663
commit 9393897817
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,9 @@
package javax.swing.plaf.synth;
import sun.swing.DefaultLookup;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
/**
@ -35,6 +37,12 @@ import javax.swing.plaf.ComponentUI;
*/
class SynthDefaultLookup extends DefaultLookup {
public Object getDefault(JComponent c, ComponentUI ui, String key) {
if (ui instanceof SynthOptionPaneUI) {
Object value = super.getDefault(c, ui, key);
if (value != null) {
return value;
}
}
if (!(ui instanceof SynthUI)) {
Object value = super.getDefault(c, ui, key);
return value;

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4174551
* @bug 4174551 8346260
* @summary JOptionPane should allow custom buttons
* @library /java/awt/regtesthelpers
* @build PassFailJFrame