|
@@ -4,6 +4,7 @@ import java.awt.*;
|
|
|
import javax.swing.*;
|
|
|
import javax.swing.event.*;
|
|
|
import java.awt.event.*;
|
|
|
+import javax.imageio.ImageIO;
|
|
|
|
|
|
public class Controls extends JPanel implements Observer
|
|
|
{
|
|
@@ -23,8 +24,15 @@ 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.play = new JButton();
|
|
|
- play.setIcon(new ImageIcon(Class.class.getResource("resources/playbutton.jpg")));
|
|
|
+ this.play = new JButton();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Image img1 = ImageIO.read(getClass().getResource("resources/playbutton.jpg"));
|
|
|
+ play.setIcon(new ImageIcon(img1));
|
|
|
+ } catch (Exception e)
|
|
|
+ {
|
|
|
+ System.out.println(e);
|
|
|
+ }
|
|
|
play.addActionListener(new ActionListener()
|
|
|
{
|
|
|
public void actionPerformed(ActionEvent e)
|