private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
        int answer;
        int selectedRow;
        switch (jTabbedPane1.getSelectedIndex()) {
            case 0:
                selectedRow = bookTable.getSelectedRow();
                if (selectedRow == -1) {
                    JOptionPane.showMessageDialog(this,
                            "Some book must be selected!",
                            "Attention!", JOptionPane.WARNING_MESSAGE);
                } else {
                    answer = JOptionPane.showConfirmDialog(this, "Do you want really delete the book",
                            "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
                    if (answer == 0) {
                        Book book = bookManager.findAllBooks().get(selectedRow);
                        bookManager.deleteBook(book);
                    }
                }
                break;
            case 1:
                selectedRow = readerTable.getSelectedRow();
                if (selectedRow == -1) {
                    JOptionPane.showMessageDialog(this,
                            "Some reader must be selected!",
                            "Attention!", JOptionPane.WARNING_MESSAGE);
                } else {
                    answer = JOptionPane.showConfirmDialog(this, "Do you want really delete the reader",
                            "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
                    if (answer == 0) {
                        Reader reader = readerManager.findAllReaders().get(selectedRow);
                        readerManager.deleteReader(reader);
                    }
                }
                break;
            case 2:
                selectedRow = readerTable.getSelectedRow();
                if (selectedRow == -1) {
                    JOptionPane.showMessageDialog(this,
                            "Some borrowing must be selected!",
                            "Attention!", JOptionPane.WARNING_MESSAGE);
                } else {
                    answer = JOptionPane.showConfirmDialog(this, "Do you want really delete the borrowing",
                            "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
                    if (answer == 0) {
                        Borrowing borrowing = borrowingManager.findAllBorrowing().get(selectedRow);
                        borrowingManager.deleteBorrowing(borrowing);
                    }
                }
                break;
            default:
                throw new IllegalArgumentException("TabbedPane wrong index.");
        }

    }//GEN-LAST:event_deleteButtonActionPerformed