public void run() {
        System.out.println("Client: run");
        while (true) {
            try {
                data = serverMsg();
                if (data.getKey().getItem().equals("@@@disconnect@@@")) {
                    break;
                }
            } catch (NullPointerException ex) {
                setDef("No connection to the server! " + ex.getMessage(), 1);
                setbtns(false);
                break;
            }
            if (data != null) {
                if (data.getOperation() == JHelp.SELECT) {
                    setbtns(true);
                    setPrevous(false);
                    setNext(false);
                    if (data.getValues() != null) {
                        if (data.getValues().length > 0) {
                            setDef(data.getValues()[0].getItem(), 0);
                            if (data.getValues().length > 1) {
                                setNext(true);
                            }
                        } else {
                            setbtns(false);
                            setFindEnabled();
                            setAddEnabled();
                            setDef("", 0);
                            setDef("The term is not found...", 2);
                        }
                    } else {
                        setbtns(false);
                        setFindEnabled();
                        setAddEnabled();
                        setDef("", 0);
                        setDef("The term is not found...", 2);
                        if (data.getKey().getItem().equals("@@@notserverdb@@@")) {
                            setDef("Lost connection to the database!", 1);
                            setbtns(false);
                        }
                    }
                }
            }
        }
    }