@Override
    public void update(Observable obs, Object ob) {

        if (obs instanceof ElectionsServer) {
            try {
                ElectionsServerThread elec = (ElectionsServerThread) ob;
                elec.addObserver(this);
            } catch (ClassCastException e) {
                System.err.println("Error casting in ServerFrame.update(Observable,Object)");
                e.printStackTrace(System.err);
            } catch (Exception e) {
                e.printStackTrace(System.err);
            }
        }

        if (obs instanceof ElectionsServerThread) {
            try {
                ElectionsServerThread elec = (ElectionsServerThread) obs;
                if (ob instanceof Exception) {
                    Exception e = (Exception) ob;
                    outputTA.append(e.getMessage() + " " + elec.getID() + "\n");
                    return;
                }
                lockedClientsLM.add(elec);
                updateButtons();
            } catch (ClassCastException e) {
                System.err.println("Error casting in ServerFrame.update(Observable,Object)");
                e.printStackTrace(System.err);
            } catch (Exception e) {
                e.printStackTrace(System.err);
            }
        }
    }