import javax.swing.*;
import java.net.URL;
import java.awt.*
.....
private URL urlForShield = SpaceShip.class.getResource("filePath1.gif");
private Image ShipShield = new ImageIcon(urlForShield,"").getImage();
private URL urlForNoShield = SpaceShip.class.getResource("filePath2.gif");
private Image ShipNoShield = new ImageIcon(urlForNoShield,"").getImage();
.....
public Image getImage() {
if (isShield) {
return ShipShield;
} else {
return ShipNoShield;
}
}
זה עיקר הקוד בכדי שהחללית תהיה תמונה שהעלתם
https://moodle2.cs.huji.ac.il/nu17/mod/forum/discuss.php?d=38845
הפתרון הרישמי מהמודל
לכבוד אסף ארד מאת יעל רנו - אין פה הסבר וזה לא עובד. תודה על כלום