@Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        Element element = elements.get(rowIndex);
        switch (columnIndex) {
            case IMAGE_COLUMN:
                try {
                    return new ImageIcon(element.getImage());
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(new JFrame(), "   " + element.getName() + ".\n"+
                            "  ,     .",
                            " !",
                            JOptionPane.ERROR_MESSAGE);
                    System.exit(0);
                }
            case NAME_COLUMN:
                return element.getName();
            case CODE_COLUMN:
                return element.getCode();
            case PRICE_COLUMN:
                return element.getPrice();
            case COUNT_COLUMN:
                return element.getCount();
        }
        return "";
    }