diff --git a/cicaprojekt/ImagePanel.java b/cicaprojekt/ImagePanel.java index d7fd475..243a779 100644 --- a/cicaprojekt/ImagePanel.java +++ b/cicaprojekt/ImagePanel.java @@ -21,5 +21,9 @@ public class ImagePanel extends JPanel{ super.paintComponent(g); g.drawImage(image, 0, 0, null); // see javadoc for more info on the parameters } - + + public void changeImage(String path) throws IOException { + image = ImageIO.read(new File(path)); + repaint(); + } } \ No newline at end of file diff --git a/cicaprojekt/WallDrawer.java b/cicaprojekt/WallDrawer.java index f5202a9..7d5aabd 100644 --- a/cicaprojekt/WallDrawer.java +++ b/cicaprojekt/WallDrawer.java @@ -14,6 +14,7 @@ public class WallDrawer extends ImagePanel implements Drawer { @Override public void draw() { + setVisible(true); }