if (table.getRowCount()>1) { PatchEdit.sortAction.setEnabled(true); PatchEdit.dupAction.setEnabled(true); }  if (table.getSelectedRowCount()>0) { PatchEdit.extractAction.setEnabled(true); PatchEdit.sendAction.setEnabled(true); PatchEdit.playAction.setEnabled(true); PatchEdit.storeAction.setEnabled(true);  Patch myPatch=((Patch)myModel.PatchList.get(table.getSelectedRow())); try{  myPatch.getDriver().getClass().getDeclaredMethod("editPatch", new Class[]{myPatch.getClass()});  PatchEdit.editAction.setEnabled(true); } catch(NoSuchMethodException ex) {  if (myPatch.getDriver() instanceof BankDriver) {  PatchEdit.editAction.setEnabled(true); } else {  PatchEdit.editAction.setEnabled(false); } };  PatchEdit.cutAction.setEnabled(true); PatchEdit.copyAction.setEnabled(true); PatchEdit.deleteAction.setEnabled(true); PatchEdit.exportAction.setEnabled(true); }
            public void internalFrameActivated (InternalFrameEvent e)            {                PatchEdit.receiveAction.setEnabled (true);                PatchEdit.pasteAction.setEnabled (true);                PatchEdit.importAction.setEnabled (true);                PatchEdit.importAllAction.setEnabled (true);                PatchEdit.newPatchAction.setEnabled(true);                PatchEdit.crossBreedAction.setEnabled(true);                                             if (table.getRowCount ()>0)                {                    PatchEdit.saveAction.setEnabled (true);                    PatchEdit.menuSaveAs.setEnabled (true);                    PatchEdit.searchAction.setEnabled (true);                }                if (table.getRowCount ()>1)                {                    PatchEdit.sortAction.setEnabled (true);                    PatchEdit.dupAction.setEnabled (true);                }                if (table.getSelectedRowCount ()>0)                {                    PatchEdit.extractAction.setEnabled (true);                    PatchEdit.sendAction.setEnabled (true);                    PatchEdit.playAction.setEnabled (true);                    PatchEdit.storeAction.setEnabled (true);                    PatchEdit.editAction.setEnabled (true);                    PatchEdit.cutAction.setEnabled (true);                    PatchEdit.copyAction.setEnabled (true);                    PatchEdit.deleteAction.setEnabled (true);                    PatchEdit.exportAction.setEnabled (true);                }                //                System.out.println ("Frame activated"+table.getSelectedRowCount ());            }