Device device=PatchEdit.appConfig.getDevice(i);
Device device=AppConfig.getDevice(i);
  public SysexGetDialog (JFrame parent) { //, Driver driver, int bankNum, int patchNum) {    super(parent, "Get Sysex Data", true);    JPanel dialogPanel = new JPanel(new BorderLayout(5, 5));//    dialogPanel.setLayout(new GridLayout(0, 1));    //myLabel = new JLabel(" ", JLabel.CENTER);    myLabel=new JLabel("Please select a Patch Type to Get.",JLabel.CENTER);    dialogPanel.add(myLabel, BorderLayout.NORTH);    //=================================== Combo Panel ======================    //----- Create the combo boxes    deviceComboBox = new JComboBox();    deviceComboBox.addActionListener(new DeviceActionListener());    driverComboBox = new JComboBox();    driverComboBox.addActionListener(new DriverActionListener());    bankNumComboBox = new JComboBox();    patchNumComboBox = new JComboBox();    // First Populate the Device/Driver List with all Device/Driver    // combinations except converters    // skip 0 (Generic Device)    for (int i=1; i < PatchEdit.appConfig.deviceCount(); i++) {      Device device=PatchEdit.appConfig.getDevice(i);      for (int j=0; j < device.driverCount(); j++) {	Driver driver = device.getDriver(j);        if (!(driver instanceof Converter)) { // Skipping a converter	  deviceComboBox.addItem(device);	  break;        }      }    }    deviceComboBox.setEnabled(deviceComboBox.getItemCount() > 1);    //----- Layout the labels in a panel.    JPanel labelPanel = new JPanel(new GridLayout(0, 1, 5, 5));    labelPanel.add(new JLabel("Device:", JLabel.LEFT));    labelPanel.add(new JLabel("Driver:", JLabel.LEFT));    labelPanel.add(new JLabel("Bank:", JLabel.LEFT));    labelPanel.add(new JLabel("Patch:", JLabel.LEFT));    //----- Layout the fields in a panel    JPanel fieldPanel = new JPanel(new GridLayout(0, 1));    fieldPanel.add(deviceComboBox);    fieldPanel.add(driverComboBox);    fieldPanel.add(bankNumComboBox);    fieldPanel.add(patchNumComboBox);   //----- Create the comboPanel, labels on left, fields on right    JPanel comboPanel = new JPanel(new BorderLayout());    comboPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));    comboPanel.add(labelPanel, BorderLayout.CENTER);    comboPanel.add(fieldPanel, BorderLayout.EAST);    dialogPanel.add(comboPanel, BorderLayout.CENTER);    //=================================== Button Panel =====================    JPanel buttonPanel = new JPanel();    buttonPanel.setLayout ( new FlowLayout (FlowLayout.CENTER) );    JButton get = new JButton("Get");    get.addActionListener(new GetActionListener());    buttonPanel.add(get);    JButton paste = new JButton("Paste");    paste.addActionListener(new PasteActionListener());    buttonPanel.add(paste);    JButton done = new JButton("Done");    done.addActionListener(new DoneActionListener());    buttonPanel.add(done);    JButton cancel = new JButton ("Cancel");    cancel.addActionListener (      new ActionListener () {        public void actionPerformed (ActionEvent e) {          setVisible(false);          timer.stop();        }      }    );    buttonPanel.add(cancel);    getRootPane().setDefaultButton(done);    dialogPanel.add(buttonPanel, BorderLayout.SOUTH);    //===================================== Timer ==========================    timer = new javax.swing.Timer(0, new TimerActionListener());    //===== Listener    //===== Final initialisation of dialog box    getContentPane().add(dialogPanel);    pack();//    setSize(600, 200);    Utility.centerDialog(this);    sysexSize = 0;  }