String name = JOptionPane.showInputDialog("New folder name"); if (name != null) { DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(name, true); addNode(node, newNode); workspace.setSelection(newNode); }
String name = JOptionPane.showInputDialog("New folder name"); if (name != null) { DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(name, true); addNode(node, newNode); workspace.setSelection(newNode);
    private void newFolder(DefaultMutableTreeNode node) {        String name = JOptionPane.showInputDialog("New folder name");        if (name != null) {            DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(name, true);            addNode(node, newNode);            workspace.setSelection(newNode);        }    }