public void removeTable(JTable table) {
        ArrayList<JTableHolder> removeTable = new ArrayList<JTableHolder>();
        ArrayList<ExcelAdapterMenuItem> removeMenu = new ArrayList<ExcelAdapterMenuItem>();
        for (int i = 0; i < tableHolders.size(); ++i) {
            if (tableHolders.get(i).getTable() == table) {
                removeTable.add(tableHolders.get(i));
                for (int j = 0; j < menuItems.size(); ++j) {
                    if (menuItems.get(j).getTableHolder() == tableHolders.get(i))
                        removeMenu.add(menuItems.get(j));
                }
            }    
        }
        for (JTableHolder th : removeTable)
            tableHolders.remove(th);
        for (ExcelAdapterMenuItem mi : removeMenu)
            menuItems.remove(mi);
        table.setComponentPopupMenu(null);
        for (KeyStroke ks : table.getRegisteredKeyStrokes())
        	table.unregisterKeyboardAction(ks);
    }