class TreeTraversal
{
public void main(String[] args) throws IOException
{
System.out.println("Displaying the tree");
theTree.displayTree();
/** 你如何打印这些东西?例如 theTree.preOrder(theTree.returnRoot()); 进入 jTextArea1 ?*/
StringBuilder order1 = new StringBuilder("Inorder traversal: ");
jTextArea1.append("\n"+order1);
//System.out.println("Inorder traversal");
theTree.inOrder(theTree.returnRoot());
//System.out.println(" ");
StringBuilder order2 = new StringBuilder("Preorder traversal: ");
jTextArea1.append("\n"+order2);
//System.out.println("Preorder traversal");
theTree.preOrder(theTree.returnRoot());
//System.out.println(" ");
StringBuilder order3 = new StringBuilder("Postorder traversal: ");
jTextArea1.append("\n"+order3);
//System.out.println("Postorder traversal");
theTree.postOrder(theTree.returnRoot());
//System.out.println(" ");
}
}