@Action
    public void deleteItem() {
        TreePath selectedPath = jTree1.getSelectionPath();
        if (selectedPath == null) {
            JOptionPane.showMessageDialog(mainPanel,
                    "Please select a category or item first",
                    "You need a category or item",
                    JOptionPane.WARNING_MESSAGE);
            return;
        }
        
        DefaultMutableTreeNode selectedNode =
                (DefaultMutableTreeNode)selectedPath.getLastPathComponent();
        if (selectedNode.getUserObject() instanceof JKeeperItem) {
            int result = JOptionPane.showConfirmDialog(mainPanel,
                    "Are you sure you want to delete the item "
                    + ((JKeeperItem) selectedNode.getUserObject()).getName()
                    + "?", "Really?", JOptionPane.YES_NO_OPTION);
            if (result == JOptionPane.NO_OPTION || result == JOptionPane.CLOSED_OPTION) {
                return;
            }
        }
        if (selectedNode.getUserObject() instanceof JKeeperCategory) {
            int result = JOptionPane.showConfirmDialog(mainPanel,
                    "Are you sure you want to delete the category "
                    + (JKeeperCategory)selectedNode.getUserObject()
                    + "?\nALL ITS ITEMS WILL BE DELETED",
                    "Really?",
                    JOptionPane.YES_NO_OPTION);
            if (result == JOptionPane.NO_OPTION || result == JOptionPane.CLOSED_OPTION) {
                return;
            }
        }
        
        jKeeperTreeModel.removeNodeFromParent(selectedNode);
        addUnsavedMark();
        
        jTree1.updateUI();
    }