if (!(Converter.class.isInstance (dev.driverList.get (j)))) index++;
try { dev.driverList.get(j).getClass().getDeclaredMethod("createNewPatch",null); if (!(Converter.class.isInstance(dev.driverList.get(j)))) index++; } catch (Exception ex) {  }
    public NewPatchDialog (JFrame Parent)    {        super(Parent,"Create New Patch",true);        Device dev;                JPanel container=new JPanel ();        container.setLayout (new BorderLayout ());                JLabel myLabel=new JLabel ("Please select a Patch Type to Create.",JLabel.CENTER);        try        {            container.add (myLabel, BorderLayout.NORTH);            final JComboBox cb =new JComboBox ();            for (int i=0;i<PatchEdit.deviceList.size ();i++)            {                dev=(Device)PatchEdit.deviceList.get (i);                for (int j=0;j<dev.driverList.size ();j++)                {                    if (!(Converter.class.isInstance (dev.driverList.get (j))))                        cb.addItem (dev.getManufacturerName ()+" "+dev.getModelName ()+" "+((Driver)(dev.driverList.get (j))).patchType);                }            }/* for (int i=1;i<PatchEdit.DriverList.size();i++) cb.addItem(          ((Driver)PatchEdit.DriverList.get(i)).manufacturer+" "+((Driver)PatchEdit.DriverList.get(i)).model+" "+          ((Driver)PatchEdit.DriverList.get(i)).patchType); */            container.add (cb,BorderLayout.CENTER);            JPanel buttonPanel=new JPanel ();            JButton done = new JButton (" OK ");            done.addActionListener (new ActionListener ()            {                public void actionPerformed (ActionEvent e)                {                    int index=0;                    for (int i=0;i<PatchEdit.deviceList.size ();i++)                    {                        final Device dev=(Device)PatchEdit.deviceList.get (i);                        for (int j=0;j<dev.driverList.size ();j++)                        {                            //System.out.println ("checking "+PatchEdit.getDriver (i,j).toString ()+" "+cb.getSelectedIndex ()+" "+index);                            if ((cb.getSelectedIndex ()==index)&&(!(Converter.class.isInstance (dev.driverList.get (j)))))                            {                                //System.out.println ("Bingo "+index);                                PatchEdit.Clipboard=PatchEdit.getDriver (i,j).createNewPatch ();                                setVisible (false);                                i=PatchEdit.deviceList.size ();                                break;                            }                            if (!(Converter.class.isInstance (dev.driverList.get (j))))                                index++;                        }                    }                }            }            );            buttonPanel.add ( done );                        JButton cancel = new JButton ("Cancel");            cancel.addActionListener (new ActionListener ()            {                public void actionPerformed (ActionEvent e)                {                    setVisible (false);                }            });            buttonPanel.add ( cancel );                        getRootPane ().setDefaultButton (done);                        container.add (buttonPanel, BorderLayout.SOUTH);            getContentPane ().add (container);            pack ();            centerDialog ();        }        catch(Exception e)        {ErrorMsg.reportStatus (e);}    }