|
@@ -5,6 +5,8 @@ import javax.swing.*;
|
|
|
import javax.swing.event.*;
|
|
|
import java.awt.event.*;
|
|
|
import javax.swing.ImageIcon;
|
|
|
+import java.awt.image.BufferedImage;
|
|
|
+import javax.imageio.ImageIO;
|
|
|
|
|
|
public class Controls extends JPanel implements Observer
|
|
|
{
|
|
@@ -29,9 +31,22 @@ public class Controls extends JPanel implements Observer
|
|
|
this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
|
|
|
this.setPreferredSize(new Dimension(1280,75));
|
|
|
this.setMinimumSize(new Dimension(320, 75));
|
|
|
- this.starImg = ImageIO.read(new File("star.png"));
|
|
|
- this.gridImg = ImageIO.read(new File("grid.png"));
|
|
|
- this.listImg = ImageIO.read(new File("list.png"));
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ this.starImg = ImageIO.read(new File("src/main/resources/star.png"));
|
|
|
+ } catch(IOException e) {}
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ this.gridImg = ImageIO.read(new File("src/main/resources/grid.png"));
|
|
|
+ } catch(IOException e) {}
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ this.listImg = ImageIO.read(new File("src/main/resources/list.png"));
|
|
|
+ } catch(IOException e) {}
|
|
|
+
|
|
|
this.starIcon = new ImageIcon(starImg);
|
|
|
this.gridIcon = new ImageIcon(gridImg);
|
|
|
this.listIcon = new ImageIcon(listImg);
|