On Thu, 1 Apr 2021 14:37:48 GMT, Tejpal Rebari <treb...@openjdk.org> wrote:
>> Hi All, >> Please review the following fix for jdk17. >> >> Issue : LookAndFeel.installProperty(list, "opaque", false) is not able to >> set the opaque property for JList and JTable. >> LookAndFeel.installProperty calls the setUIProperty, and setUIProperty >> checks for OPAQUE_SET to change the opaque property as requested by the >> client. >> OPAQUE_SET is always set to true when there is call to setOpaque(boolean).So >> when the constructor calls setOpaque(true) OPAQUE_SET is set to true and >> wont allow the setUIProperty to change the opaque property. >> installProperty should work as the opaque property is not set by the client. >> >> Fix. Fix is to remove the call to the setOpaque() from the constructor of >> JList and JTable. This will allow the client to change the opaque property >> calling LookAndFeel.installProperty() when the property is already not set. >> >> Test : Added a test to check the same. Also tested internal tests which >> all are passing. >> Link is in JBS. > > Tejpal Rebari has updated the pull request incrementally with one additional > commit since the last revision: > > Fix for JTree JTooltip and JViewport keeping default opaque value same, > modified the test src/java.desktop/share/classes/javax/swing/plaf/nimbus/skin.laf line 27251: > (failed to retrieve contents of file, check the PR for context) In my opinion, instead of changing skin.laf we probably should update SynthToolTipUI.installDefaults() and add `LookAndFeel.installProperty(c, "opaque", Boolean.TRUE);` similar to what we do for BasicToolTipUI.installDefaults. Will it not work? test/jdk/javax/swing/JList/TestOpaqueListTable.java line 24: > 22: */ > 23: > 24: import javax.swing.*; Can you please update this wildcard imports? test/jdk/javax/swing/JList/TestOpaqueListTable.java line 31: > 29: * @summary setUIProperty should work when opaque property is not set by > 30: * client > 31: * @key headful Does it need to be headful? ------------- PR: https://git.openjdk.java.net/jdk/pull/3167