public class MooInstrumentList extends JComboBox implements ActionListener {
protected int channel;
- public MooInstrumentList(int chan) {
+
+ public MooInstrumentList(int instrument) {
super(instruments);
- setChannel(chan);
+ setSelectedIndex(instrument);
setFont(new Font("Helvetica", Font.PLAIN, 10));
addActionListener(this);
}
channel = chan;
setSelectedIndex(Moosique.getChannel(chan).getProgram());
}
+
public void actionPerformed(ActionEvent e) {
JComboBox box = (JComboBox)e.getSource();
int instrument = box.getSelectedIndex();