void changeImage(String path) added to ImagePanel.
This commit is contained in:
parent
573518d14b
commit
1c847c06ae
@ -21,5 +21,9 @@ public class ImagePanel extends JPanel{
|
|||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
g.drawImage(image, 0, 0, null); // see javadoc for more info on the parameters
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
@ -14,6 +14,7 @@ public class WallDrawer extends ImagePanel implements Drawer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw() {
|
public void draw() {
|
||||||
|
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user