In this section, you will learn how to remove a node from the JTree component. Removing a node from JTree it means delete a node from the JTree component to individually and delete the root node directly.
Tutorial Details:
The following program helps you in removing or deleting root and child of root node from the JTree component. When this program runs, it will provide a graphical layout that has tree and two command button: "Remove Specific Node" and "Remove Root Node". If you want to delete an individual node from the JTree, you will click the "Remove Specific Node" button. After clicking this command button appears an input box that takes the name of node that have to be deleted from the JTree. If this input box is empty or blank, it will display a message "Node could not be deleted from tree" in message box and any node is not deleted from JTree. Again, you click the Remove Specific Node" button, it will take node name (New Volume (E:)) in the input box and click the "OK" command button. The given node is deleted from the JTree and it will display a message "Node are deleted from tree" in message box. And if you want to delete the root from JTree, you will click the "Remove Root Node" button, the root is deleted from the JTree and shows a message "Remove the root" in message box and both buttons are disable.
Rate Tutorial: http://www.roseindia.net/java/example/java/swing/RemoveNodes.shtml
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: JTree Remove Node
View Tutorial: JTree Remove Node
Related
Tutorials:
Java 2 introduces print
capability to
the Swing Forum - JavaWorld June 1999
Java 2 introduces print
capability to
the Swing Forum - JavaWorld June 1999 |
Add drag and drop to your JTrees - JavaWorld Tip
97
Add drag and drop to your JTrees - JavaWorld Tip
97 |
Programming XML in Java, Part 3 - JavaWorld July
2000
Programming XML in Java, Part 3 - JavaWorld July
2000 |
Easy Java/XML integration with
JDOM, Part 2 - JavaWorld July
2000
Easy Java/XML integration with
JDOM, Part 2 - JavaWorld July
2000 |
XML document
processing in Java using XPath and XSLT - JavaWorld September 2000
XML document
processing in Java using XPath and XSLT - JavaWorld September 2000 |
Mapping XML to Java, Part 2 - JavaWorld October
2000
Mapping XML to Java, Part 2 - JavaWorld October
2000 |
Combine the power
of XPath and JSP
tag libraries -
JavaWorld January
2001
Combine the power
of XPath and JSP
tag libraries -
JavaWorld January
2001 |
Plant your data in a ternary search tree -
JavaWorld
February 2001
Plant your data in a ternary search tree -
JavaWorld
February 2001 |
Breathe intelligence into Java - JavaWorld April 2001
Breathe intelligence into Java - JavaWorld April 2001 |
Jato: The new kid on the open source block, Part 3 - JavaWorld May
2001
Jato: The new kid on the open source block, Part 3 - JavaWorld May
2001 |
J2EE clustering,
Part 2 - JavaWorld August 2001
J2EE clustering,
Part 2 - JavaWorld August 2001 |
Add ghosted drag
images to your JTrees - JavaWorld
Tips
Add ghosted drag
images to your JTrees - JavaWorld
Tips |
Sir, what is your preference?
Sir, what is your preference? |
Check out three
collections libraries
Check out three
collections libraries |
A first look at JavaServer Faces, Part I
A first look at JavaServer Faces, Part Learn how to implement Web-based user interfaces with JSF |
SAAJ: No strings attached
SAAJ: No strings attached |
Bug patrol
Bug patrol |
HA-JDBC: High-Availability JDBC
HA-JDBC: High-Availability JDBC
Summary
HA-JDBC is a JDBC driver proxy that provides light-weight, transparent clustering capability to any underlying JDBC driver.
|
Create intelligent Web spiders
Create intelligent Web spiders
This article demonstrates how to create an intelligent Web spider based on standard Java network objects. The heart of this spider is a recursive routine that can perform depth-first Web searches based on keyword/phrase cri |
Parsing an XML Document with XPath
The getter methods in the org.w3c.dom package API are commonly used to parse an XML document. But J2SE 5.0 also provides the javax.xml.xpath package to parse an XML document with the XML Path Language (XPath) .
|
|
|
|