Heirs of ImagePanel now throw IOException.

This commit is contained in:
ericnerdo 2016-05-07 14:40:52 +02:00
parent 17d7f46d78
commit 573518d14b
4 changed files with 11 additions and 8 deletions

View File

@ -1,10 +1,12 @@
package cicaprojekt;
import java.io.IOException;
public class FieldDrawer extends ImagePanel implements Drawer {
Field field;
public FieldDrawer(Field f) {
public FieldDrawer(Field f) throws IOException {
super("Field.png");
field = f;
setVisible(false);

View File

@ -1,10 +1,12 @@
package cicaprojekt;
import java.io.IOException;
public class GapDrawer extends ImagePanel implements Drawer{
private Gap gap;
public GapDrawer(Gap g) {
public GapDrawer(Gap g) throws IOException {
super("Gap.png");
gap = g;
setVisible(false);

View File

@ -12,11 +12,8 @@ public class ImagePanel extends JPanel{
private BufferedImage image;
public ImagePanel(String path) {
try {
image = ImageIO.read(new File(path));
} catch (IOException ex) {
}
public ImagePanel(String path) throws IOException {
image = ImageIO.read(new File(path));
}
@Override

View File

@ -1,10 +1,12 @@
package cicaprojekt;
import java.io.IOException;
public class WallDrawer extends ImagePanel implements Drawer {
Wall wall;
public WallDrawer(Wall w) {
public WallDrawer(Wall w) throws IOException {
super("Wall.png");
wall = w;
setVisible(false);