sdedic commented on a change in pull request #3459:
URL: https://github.com/apache/netbeans/pull/3459#discussion_r786016696
##########
File path: platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
##########
@@ -117,18 +124,27 @@
* {@link Icon#paintIcon(Component, Graphics, int, int)} when converting
an {@code Icon} to an
* {@code Image}. See comment in {@link #icon2ToolTipImage(Icon, URL)}.
*/
- private static volatile Component dummyIconComponent;
+ private static volatile Component dummyIconComponentLabel;
+
+ /**
+ * Second dummy component. Some {@link Icon#paintIcon(java.awt.Component,
java.awt.Graphics, int, int)} are very picky and downcast the
+ * Component to a specific subclass. JCheckBox will satisfy checkboxes,
abstract buttons etc. Will not eliminate all cases, but helps.
+ *
+ */
+ private static volatile Component dummyIconComponentButton;
static {
/* Could have used Mutex.EVENT.writeAccess here, but it doesn't seem
to be available during
testing. */
if (EventQueue.isDispatchThread()) {
- dummyIconComponent = new JLabel();
+ dummyIconComponentLabel = new JLabel();
+ dummyIconComponentButton = new JCheckBox();
Review comment:
> which method(s) specifically
`ImageUtilities.icon2Image`; that ultimately calls `paintIcon()` to get the
icon rendered to a `BufferedImage`. OS Linux / KDE, JDK 8+11, default L&F.
> Why haven't these cases come up before?
Nobody called `icon2Image` on those particular UIManager icons ?
--
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