RFR: 8068293: [TEST_BUG] Test closed/com/sun/java/swing/plaf/motif/InternalFrame/4150591/bug4150591.java fails with GTKLookAndFeel

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Oct 17 07:22:05 UTC 2025


On Fri, 17 Oct 2025 07:11:26 GMT, Tejesh R <tr at openjdk.org> wrote:

>> Test fails in GTKLookAndFeel with NPE
>> 
>> java.lang.NullPointerException
>> at javax.swing.border.BevelBorder.<init>(BevelBorder.java:78)
>> at javax.swing.BorderFactory.createBevelBorder(BorderFactory.java:155)
>> at com.sun.java.swing.plaf.motif.MotifInternalFrameTitlePane$Title.<init>(MotifInternalFrameTitlePane.java:325) 
>> 
>> because `BorderFactory.createBevelBorder` tries to use brighter shade of highlight and shadow color which it tries to obtain from 
>> `UIManager.getColor("activeCaptionBorder")` and `UIManager.getColor("inactiveCaptionBorder")` both of which are not defined in GTK L&F as caption border are not used there
>> 
>> Fix is made to not use these color to create BevelBorder if these colors are not present..
>
> src/java.desktop/share/classes/javax/swing/BorderFactory.java line 156:
> 
>> 154:      */
>> 155:     public static Border createBevelBorder(int type, Color highlight, Color shadow) {
>> 156:         if (highlight != null && shadow != null) {
> 
> Should we update the doc about `null` case too ?

Dont think its required..We are still returning a bevel border

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27839#discussion_r2438647986


More information about the client-libs-dev mailing list