Heirs of ImagePanel now throw IOException.
This commit is contained in:
parent
17d7f46d78
commit
573518d14b
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user