faderController[currentFader]=cbController.getSelectedIndex (); faderChannel[currentFader]=cbChannel.getSelectedIndex (); cbController.setSelectedIndex (faderController[lb1.getSelectedIndex ()]); cbChannel.setSelectedIndex (faderChannel[lb1.getSelectedIndex ()]);
appConfig.setFaderController(currentFader, cbController.getSelectedIndex()); appConfig.setFaderChannel(currentFader, cbChannel.getSelectedIndex()); cbController.setSelectedIndex (appConfig.getFaderController(lb1.getSelectedIndex())); cbChannel.setSelectedIndex (appConfig.getFaderChannel(lb1.getSelectedIndex()));
    protected JPanel makeCard3 ()    { JPanel panel=new JPanel ();      panel.setLayout (new GridBagLayout ());      GridBagConstraints gbc=new GridBagConstraints ();      JLabel l0=new JLabel ("Receive Faders from Midi Port:  ");      gbc.gridx=0;gbc.gridy=1;gbc.gridwidth=3;gbc.gridheight=1;      panel.add (l0,gbc);      cb4 = new JComboBox ();      try      {          for (int j=0; j< PatchEdit.MidiIn.getNumInputDevices ();j++)              cb4.addItem (j+": "+PatchEdit.MidiIn.getInputDeviceName (j));      }catch (Exception e)      {}            gbc.gridx=3;gbc.gridy=1;gbc.gridwidth=3;gbc.gridheight=1;      panel.add (cb4,gbc);      enabledBox=new JCheckBox ("Enable Faders");      gbc.gridx=6;gbc.gridy=1;gbc.gridwidth=1;gbc.gridheight=1;      panel.add (enabledBox,gbc);            String n[]=new String[37];      n[0]="Active Slider";      for (int i=0;i<16;i++) n[i+1]=("Slider #"+(i+1));      for (int i=0;i<12;i++) n[i+17]=("Button #"+(i+1));      n[29]="Button #13";      n[30]="Button #14";      n[31]="Slider Bank Prev";      n[32]="Slider Bank Next";      String cc1[] = new String[129];      String cc2[] = new String[17];      for (int i=0;i<128;i++) cc1[i]=(""+(i));      cc1[128]="Off";      for (int i=0;i<16;i++) cc2[i]=(""+(i+1));      cc2[16]="Off";      cbController=new JComboBox (cc1);      cbChannel=new JComboBox (cc2);      lb1=new JList (n);      lb1.addListSelectionListener (new ListSelectionListener ()      {          public void valueChanged (ListSelectionEvent e)          {              faderController[currentFader]=cbController.getSelectedIndex ();              faderChannel[currentFader]=cbChannel.getSelectedIndex ();              cbController.setSelectedIndex (faderController[lb1.getSelectedIndex ()]);              cbChannel.setSelectedIndex (faderChannel[lb1.getSelectedIndex ()]);              currentFader=lb1.getSelectedIndex ();          }      });      lb1.setSelectedIndex (0);      lb1.setSelectionMode (0);      gbc.gridx=0;gbc.gridy=5;gbc.gridwidth=2;gbc.gridheight=3;      JScrollPane scroll=new JScrollPane (lb1);      panel.add (scroll,gbc);      JPanel dataPanel=new JPanel ();      dataPanel.setLayout (new GridBagLayout ());      gbc.anchor=GridBagConstraints.EAST;      gbc.gridx=0;gbc.gridy=1;gbc.gridwidth=1;gbc.gridheight=1; dataPanel.add (new JLabel ("Midi Controller #  "),gbc);      gbc.gridx=0;gbc.gridy=2;gbc.gridwidth=1;gbc.gridheight=1; dataPanel.add (new JLabel ("Midi Channel    #  "),gbc);      gbc.gridx=1;gbc.gridy=1;gbc.gridwidth=1;gbc.gridheight=1;      dataPanel.add (cbController,gbc);      gbc.gridx=1;gbc.gridy=2;gbc.gridwidth=1;gbc.gridheight=1;      dataPanel.add (cbChannel,gbc);      gbc.gridx=2;gbc.gridy=5;gbc.gridwidth=5;gbc.gridheight=3;  gbc.fill=GridBagConstraints.BOTH;      dataPanel.setBorder (new EtchedBorder (EtchedBorder.RAISED));      panel.add (dataPanel,gbc);      JPanel buttonPanel = new JPanel ();      JButton b1 = new JButton ("Peavey PC1600x Preset");      JButton b2 = new JButton ("Kawai K5000 Knobs Preset");      b1.addActionListener (new ActionListener ()      {          public void actionPerformed (ActionEvent e)          {              PresetPC1600x ();          }      });      b2.addActionListener (new ActionListener ()      {          public void actionPerformed (ActionEvent e)          {              PresetKawaiK5000 ();          }      });            buttonPanel.add (b1); buttonPanel.add (b2);      gbc.gridx=0;gbc.gridy=8;gbc.gridwidth=7;gbc.gridheight=1;  gbc.fill=GridBagConstraints.BOTH;      panel.add (buttonPanel,gbc);      return panel;    }