]> ruin.nu Git - moosique.git/blobdiff - MooToolbar.java
tja...
[moosique.git] / MooToolbar.java
index 5eae4772a3b12120f0a4ea6777c500a4af00ae37..bca5b5430e69b2032e8940c59f1e887a1d1382d4 100644 (file)
@@ -1,18 +1,47 @@
 import javax.swing.*;
+import java.awt.event.*;
 
-/**
- * 
- * 
- * @author  Andersson, Andreen, Lanneskog, Pehrson
- * @version 1
- */
-public class MooToolbar {
+public class MooToolbar extends JToolBar implements ActionListener     {
 
-       /** 
-        * Creates the toolbar.
-        */
-       public MooToolbar () {
+       public MooToolbar()     {
+       
+               rewind = createButton("images/rewind.gif", "rewind");
+               add(rewind);
 
-       }
+               playpause = createButton("images/play.gif", "play");
+               add(playpause);
+               
+               stop = createButton("images/stop.gif", "stop");
+               add(stop);
+               
+               fastforward = createButton("images/forward.gif", "fast forward");
+               add(fastforward);
+               
+               }
+               
+               private JButton createButton(String imageLocation, String toolTip) {
+                       JButton button = new JButton (new ImageIcon(imageLocation));
+                       button.setToolTipText(toolTip);
+                       button.addActionListener(this);
+                       return button;
+               }
+               
+               public void actionPerformed(ActionEvent e) {
+                       Object ob = e.getActionCommand();
+                       
+                       if (ob == rewind) {
+                       
+                       } else if (ob == playpause) {
+                               JOptionPane.showMessageDialog(null, "playing");
+                       
+                       } else if (ob == stop) {
+                       
+                       } else if (ob == rewind) {
+                       
+                       }
+               }
+               private JButton rewind;
+               private JButton playpause;
+               private JButton stop;
+               private JButton fastforward;
 }