I need to use the ImageIcon to draw additional shapes on it. I get a ClassCastException when I try to cast the Icon from getIcon to ImageIcon.
I tried getting the Image object through loadFromResource so I can draw on that but the image does not show on the retina screen (in a JMenuItem). When there's no @2x image the standard image shows though. I'm using JDK8.
I fiddled with the IconLoader but I'm not able to get a scaled down version of the image (change the code to use ImageIO class).
I need to use the ImageIcon to draw additional shapes on it. I get a
ClassCastExceptionwhen I try to cast theIconfromgetIcontoImageIcon.I tried getting the
Imageobject throughloadFromResourceso I can draw on that but the image does not show on the retina screen (in a JMenuItem). When there's no@2ximage the standard image shows though. I'm using JDK8.I fiddled with the
IconLoaderbut I'm not able to get a scaled down version of the image (change the code to useImageIOclass).