public void setType(int color) {
        setIcon(null);
        setText("");
        switch (color) {
            case 0:
                setIcon(new IconBlack());
                break;
            case 1:
                setIcon(new IconWhite());
                break;
            case 2:
                setIcon(new IconKing());
                break;
        }
    }