]> ruin.nu Git - moosique.git/blob - MooToolbar.java
försöker och försöker
[moosique.git] / MooToolbar.java
1 import javax.swing.*;
2 import java.awt.event.*;
3
4 public class MooToolbar extends JToolBar        {
5
6         public MooToolbar()     {
7         
8                 rewind = createButton("images/rewind.gif", "rewind");
9                 add(rewind);
10
11                 playpause = createButton("images/play.gif", "play");
12                 add(playpause);
13                 
14                 stop = createButton("images/stop.gif", "stop");
15                 add(stop);
16                 
17                 fastforward = createButton("images/forward.gif", "fast forward");
18                 add(fastforward);
19                 
20                 meas = createProgressIndikator("meas");
21                 add(meas);
22                 }
23                 
24                 private JButton createButton(String imageLocation, String toolTip) {
25                         JButton button = new JButton (new ImageIcon(imageLocation));
26                         button.setToolTipText(toolTip);
27                         return button;
28                 }
29                 
30                 private JPanel createProgressIndikator(String name) {
31                         JPanel panel = new JPanel();
32                         JLabel label = new JLabel(name);
33                         JComboBox combo = new JComboBox();
34                         add(label);
35                         add(combo);
36                         return panel;
37                         
38                 
39                 }
40                 
41                 /*public void actionPerformed(ActionEvent e) {
42                         String but = e.getActionCommand();
43                         
44                         if (but == "rewind") {
45                         
46                         } else if (but == "images/play.gif") {
47                                 JOptionPane.showMessageDialog(null, "playing");
48                         
49                         } else if (but == "stop") {
50                         
51                         } else if (but == "rewind") {
52                         
53                         }
54                 }*/
55                 private JButton rewind;
56                 private JButton playpause;
57                 private JButton stop;
58                 private JButton fastforward;
59                 private JPanel meas;
60 }