Hello Tree
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
public class TreeDemo extends Jframe {
JTree tree;
DefaultTreeModel treeModel;
String[] strLeaves =
{"Leaf 1.", "Leaf 2.", "Leaf 3.", "Subroot "};
public TreeDemo(){
super ("Demonstration of JTree");
setSize(200,400);
addWindowListener
(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
Previous slide
Next slide
Back to first slide
View graphic version