private void sortFolder() {
		DndTreeNode parent = getSelectedFolder();
		if (JOptionPane.showConfirmDialog(this, "Sort folder '"
				+ parent.getLabel() + "' contents?", "Confirm Sort",
				JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
			
			// Remove all of the folder items (sub-folders and/or leaf nodes)
			List<DndTreeNode> tempList = new ArrayList<DndTreeNode>(folderModel.getChildCount(parent));
			while (folderModel.getChildCount(parent) > 0) {
				DndTreeNode child = (DndTreeNode) folderModel.getChild(parent, 0);
				folderModel.removeNodeFromParent(child);
				tempList.add(child);
			}
			
			// Sort the folder contents: the sub-folders should appear first, and
			// then the managed items
			Collections.sort(tempList, new Comparator<DndTreeNode>() {
				public int compare(DndTreeNode node1, DndTreeNode node2) {
					if (node1.getAllowsChildren() ^ node2.getAllowsChildren()) {
						return node1.getAllowsChildren() ? -1 : 1;
					} else {
						return node1.getLabel().compareToIgnoreCase(node2.getLabel());
					}
				}
			});
			
			// Return the items to the folder, sorted by their label
			for (int i = 0; i < tempList.size(); i++) {
				DndTreeNode child = tempList.get(i);
				folderModel.insertNodeInto(child, parent, parent.getChildCount());
			}
		}
	}