gbc.gridx=1; gbc.gridy=6; gbc.gridheight=1; gbc.gridwidth=1;gbc.fill=gbc.NONE;
gbc.gridx=1; gbc.gridy=6; gbc.gridheight=1; gbc.gridwidth=1;gbc.fill=GridBagConstraints.NONE;
    public MidiConfigPanel(AppConfig appConfig) {	super(appConfig);	driverChangeListeners = new Vector();	setLayout (new core.ColumnLayout ());	setPreferredSize(new Dimension(500,250));	cbxEnMidi = new JCheckBox ("Enable MIDI Interface");	cbxEnMidi.addActionListener(new ActionListener() {		public void actionPerformed (ActionEvent e) {		    setContainerEnabled(channelPanel, cbxEnMidi.isSelected());		    cbMC.setEnabled(cbxEnMC.isSelected());		}	});	add(cbxEnMidi);	// MIDI wrapper selection Combobox	if (!PatchEdit.newMidiAPI) { // only Javasound	    JLabel l2 = new JLabel ("MIDI Access Method:");	    add (l2);	    cbDriver=new JComboBox ();	    add (cbDriver);	    // Fill the combo box with all Midi wrappers in the midiimps vector	    Vector midiImps = appConfig.midiWrappers;	    for(int i=0; i<midiImps.size(); i++) {		cbDriver.addItem(midiImps.elementAt(i));	    }	    cbDriver.addItemListener (new ItemListener () {		    public void itemStateChanged (ItemEvent e) {			if (e.getStateChange ()==ItemEvent.SELECTED) {			    System.out.println("itemStateChanged");			    resetMidiDriver();			    //resetPortComboBoxes();			    //midiDriverSelected((MidiWrapper) ((JComboBox)e.getSource()).getSelectedItem());			}		    }		});	}	// panel for other settings	channelPanel = new JPanel();        channelPanel.setLayout(new core.ColumnLayout());	GridBagLayout gridbag = new GridBagLayout();	GridBagConstraints gbc = new GridBagConstraints();	cbPanel = new JPanel(gridbag);	gbc.fill=gbc.HORIZONTAL;	gbc.ipadx=1;	gbc.anchor=gbc.WEST;	// make a space	gbc.gridx=0; gbc.gridy=2; gbc.gridheight=1; gbc.gridwidth=1;	JLabel l3=new JLabel (" ");	gridbag.setConstraints(l3, gbc);        cbPanel.add (l3);	// Output Port/Input Port selection	gbc.gridx=0; gbc.gridy=3; gbc.gridheight=1; gbc.gridwidth=3; //gbc.gridwidth=gbc.REMAINDER;        JLabel cbLabel = new JLabel ("Run Startup Initialization on MIDI Ports:");	gridbag.setConstraints(cbLabel, gbc);	cbPanel.add (cbLabel);	gbc.gridx=0; gbc.gridy=4; gbc.gridheight=1; gbc.gridwidth=1;	JLabel cbOutLabel = new JLabel("Out Port:");	gridbag.setConstraints(cbOutLabel, gbc);	cbPanel.add (cbOutLabel);	if (PatchEdit.newMidiAPI)	    cbOut = new JComboBox(MidiUtil.getOutputMidiDeviceInfo());	else	    cbOut = new JComboBox();	gbc.gridx=1; gbc.gridy=4; gbc.gridheight=1; gbc.gridwidth=gbc.REMAINDER;	gridbag.setConstraints(cbOut, gbc);        cbPanel.add (cbOut);	gbc.gridx=0; gbc.gridy=5; gbc.gridheight=1; gbc.gridwidth=1;	JLabel cbInLabel = new JLabel("In Port:");	gridbag.setConstraints(cbInLabel, gbc);        cbPanel.add (cbInLabel);	if (PatchEdit.newMidiAPI)	    cbIn = new JComboBox(MidiUtil.getInputMidiDeviceInfo());	else	    cbIn = new JComboBox();	gbc.gridx=1; gbc.gridy=5; gbc.gridheight=1; gbc.gridwidth=gbc.REMAINDER;	gridbag.setConstraints(cbIn, gbc);        cbPanel.add (cbIn);	// MIDI loopback test	gbc.gridx=1; gbc.gridy=6; gbc.gridheight=1; gbc.gridwidth=1;gbc.fill=gbc.NONE;        JButton testButton = new JButton("MIDI Loopback Test...");	testButton.addActionListener (new ActionListener () {		public void actionPerformed (ActionEvent e) {		    MidiTest.runLoopbackTest(AppConfig.getMidiWrapper(),					     cbIn.getSelectedIndex(),					     cbOut.getSelectedIndex());		}	    });	gridbag.setConstraints(testButton, gbc);	cbPanel.add(testButton);	// make a space	gbc.gridx=0; gbc.gridy=7; gbc.gridheight=1; gbc.gridwidth=1; gbc.fill=gbc.HORIZONTAL;	JLabel l0=new JLabel (" ");	gridbag.setConstraints(l0, gbc);        cbPanel.add (l0);	// master controller selection	gbc.gridx=0; gbc.gridy=8; gbc.gridheight=1; gbc.gridwidth=gbc.REMAINDER; // gbc.gridwidth=3;	JLabel l1=new JLabel ("Receive from Master Controller on MIDI Port:");	gridbag.setConstraints(l1, gbc);        cbPanel.add (l1);	cbxEnMC = new JCheckBox ("Enable Master Controller");	gbc.gridx = 1; gbc.gridy = 9; gbc.gridwidth = 1; gbc.gridheight = 1;	cbPanel.add(cbxEnMC, gbc);	cbxEnMC.addActionListener(new ActionListener() {		public void actionPerformed (ActionEvent e) {		    cbMC.setEnabled(cbxEnMC.isSelected());		}	    });	gbc.gridx=1; gbc.gridy=10; gbc.gridheight=1; gbc.gridwidth=gbc.REMAINDER;	if (PatchEdit.newMidiAPI)	    cbMC = new JComboBox(MidiUtil.getInputMidiDeviceInfo());	else	    cbMC = new JComboBox();	gridbag.setConstraints(cbMC, gbc);        cbPanel.add (cbMC);	channelPanel.add(cbPanel);	add(channelPanel);	//init();    }