sdedic commented on a change in pull request #3414:
URL: https://github.com/apache/netbeans/pull/3414#discussion_r779908136
##########
File path: platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
##########
@@ -352,7 +369,14 @@ private static ToolTipImage icon2ToolTipImage(Icon icon,
URL url) {
should really only be called on the Event Dispatch Thread.
Constructing the component once
on the EDT fixed the problem. Read-only operations from non-EDT
threads shouldn't really be
a problem; most Icon implementations won't ever access the component
parameter anyway. */
- icon.paintIcon(dummyIconComponent, g, 0, 0);
+ try {
+ icon.paintIcon(dummyIconComponent, g, 0, 0);
+ } catch (ClassCastException ex) {
+ // java.desktop/javax.swing.plaf.metal.OceanTheme$IFIcon.paintIcon
assumes a different component,
+ // so let's try second most used one type, it satisfies
AbstractButton, JCheckbox. Not all cases are
+ // covered, however.
Review comment:
Well, more cases will be resolved by the delegating lazy UIDefaults that
you've suggested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists