import javax.swing.*;
+import java.awt.event.*;
-public class MooToolbar extends JToolBar {
+public class MooToolbar extends JToolBar implements ActionListener {
public MooToolbar() {
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;