T
teter2
Will ein ImageIcon resizen, bekomme aber eine Exception bei
. Wie kann ich den Fehler beheben?
Java:
Graphics2D imageGraphics=(Graphics2D)image.getGraphics();
Java:
public static ImageIcon resizeImageIcon(ImageIcon imageIcon){
Image image=imageIcon.getImage();
Graphics2D imageGraphics=(Graphics2D)image.getGraphics();
imageGraphics.setRenderingHint(
RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
imageIcon.setImage(image.getScaledInstance(100,100,Image.SCALE_SMOOTH));
return imageIcon;
}