@Override
    public void categoryShow(int refresh) {
        // TODO Auto-generated method stub
        appListener.getCategory();
        jTable1 = new JTable(tablemodel) {

            private static final long serialVersionUID = 1L;

            /**
             *
             * @param row row number
             * @param column column number
             * @return return true or false
             */
            public boolean isCellEditable(int row, int column) {
                if (column == 0 || column == 1) {
                    return false;
                } else {
                    return true;
                }
            }



            /**
             *
             * @param renderer TableCellRenderer
             * @param Index_row index_row number
             * @param Index_col index_col number
             * @return return Component
             */
            public Component prepareRenderer
            (TableCellRenderer renderer,int Index_row, int Index_col) {
                Component comp = super.prepareRenderer(renderer, Index_row, Index_col);
                 if (Index_row % 2 == 0 && !isCellSelected(Index_row, Index_col)) {
                     comp.setBackground(new Color(240,248,255));
                 } else {
                     comp.setBackground(new Color(198,226,255));
                 }
                JComponent jc = (JComponent) comp;
                if (Index_col >1 ) {
                    jc.setToolTipText("Edytuj: "
                            + getValueAt(Index_row, Index_col).toString());
                }
                return comp;
            }
        };
        scroll = new JScrollPane(jTable1);
        scroll.setPreferredSize(new Dimension(820,600));

        TableColumnModel tcm = jTable1.getColumnModel();
        tablemodel.addColumn("Lp.");
        tablemodel.addColumn("ID");
        tablemodel.addColumn("Nazwa");

        JPopupMenu popupMenu = new JPopupMenu();
        JMenuItem menuItemRemove = new JMenuItem("Usuń");
        popupMenu.add(menuItemRemove);
        jTable1.setComponentPopupMenu(popupMenu);
        menuItemRemove.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int selRow = (Integer) jTable1.getValueAt(jTable1.getSelectedRow(), 1);
                fireDeleteEvent(new CompanyEvent(null, "kategorie",
                        null, selRow, ""), "kategorie");

            }
        });


        jTable1.addMouseListener(new TableMouseListener(jTable1));

        jTable1.setRowHeight(20);
        jTable1.getColumn("ID").setCellEditor(null);
        jTable1.getTableHeader().setFont(new Font("Arial", 0, 15));
        tcm.getColumn(0).setMaxWidth(50);
        tcm.getColumn(1).setMaxWidth(50);

        int flag;
        flag = 1;
        if (refresh == 1) {

        } else {
            if (flag == 1) {
                // loadData();
                flag++;
            }

            controls = new JPanel(new BorderLayout(5, 5));
            buttons = new JPanel(new GridLayout(0, 1, 4, 4));
            newrow = new JButton("Dodaj");
            print = new JButton("Drukuj");
            deletebutton = new JButton("Usuń");

            tableEdit(jTable1); // edycja tabeli

            print.addActionListener(new ActionListener() {
                /**
                 *
                 * @param arg0 actionPerformed argument
                 */
                @Override
                public void actionPerformed(ActionEvent arg0) {
                    // TODO Auto-generated method stub
                    try {
                        jTable1.print();
                    } catch (PrinterException pe) {
                        System.err.println("Blad przy drukowaniu");
                    }
                }
            });
            newrow.addActionListener(new ActionListener() {

                /**
                 *
                 * @param e actionPerformed argument
                 */
                @Override
                public void actionPerformed(ActionEvent e) {

                    final JFrame newpopup = new JFrame("Dodaj nową kategorie");
                    newpopup.setSize(500, 280);
                    newpopup.setLocationRelativeTo(null);
                    newpopup.setResizable(false);
                    newpopup.setLayout(new GridBagLayout());

                    newpopup.setBackground(Color.gray);
                    GridBagConstraints c = new GridBagConstraints();

                    JPanel acctInfo = new JPanel(new GridBagLayout());
                    c.gridx = 0;
                    c.gridy = 0;
                    c.gridwidth = 2;
                    c.gridheight = 1;
                    c.insets = new Insets(5, 5, 5, 5);
                    newpopup.add(acctInfo, c);
                    c.gridwidth = 1;

                    JLabel custNameLbl = new JLabel("Nazwa kategorii");
                    c.gridx = 0;
                    c.gridy = 0;
                    c.insets = new Insets(0, 0, 0, 0);
                    acctInfo.add(custNameLbl, c);
                    c.weightx = 1.;

                    c.fill = GridBagConstraints.HORIZONTAL;
                    custNameTxt = new JTextField("", 1000);
                    c.gridx = 1;
                    c.gridy = 0;
                    c.insets = new Insets(5, 5, 5, 5);
                    acctInfo.add(custNameTxt, c);

                    closeBtn = new JButton("Anuluj");
                    c.gridx = 0;
                    c.gridy = 3;
                    c.insets = new Insets(5, 5, 5, 5);
                    acctInfo.add(closeBtn, c);

                    savingsBtn = new JButton("Dodaj nową kategorie");
                    c.gridx = 1;
                    c.gridy = 3;
                    c.insets = new Insets(5, 5, 5, 5);
                    acctInfo.add(savingsBtn, c);

                    newpopup.setVisible(true);

                    closeBtn.addActionListener(new ActionListener() {
                        /**
                         *
                         * @param e actionPerformed argument
                         */
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            newpopup.dispose();
                        }
                    });

                    savingsBtn.addActionListener(new ActionListener() {
                        /**
                         *
                         * @param e actionPerformed argument
                         */
                        @Override
                        public void actionPerformed(ActionEvent e) {

                            String name = custNameTxt.getText();
                            if (!name.isEmpty()) {
                                JOptionPane.showMessageDialog(View.this,
                                        "Dodano", "Dodano",
                                        JOptionPane.INFORMATION_MESSAGE);

                                fireCategoryEvent(new CategoryEvent(name,
                                        "kategorie", 0, "add"));
                            } else {
                                JOptionPane.showMessageDialog(View.this,
                                        "Uzupełnij pole",
                                        "Uzupełnij pole",
                                        JOptionPane.WARNING_MESSAGE);
                            }
                        }
                    });
                }
            });

            deleteAction(jTable1, "kategorie");

            buttons.add(newrow);
            buttons.add(deletebutton);
            buttons.add(print);
            buttons.setBorder(new TitledBorder("Zarządzaj"));

            controls.add(buttons, BorderLayout.NORTH);

            card1.add(scroll);
            card1.add(controls);
        }
    }