java二叉树家谱实现

来源:百度知道 编辑:UC知道 时间:2024/05/03 01:21:24

mport java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;

public class Randomtree extends JFrame {

private JTree tree;
public static String[] school = { "初中课程", "高中课程", "大学课程" };
public static String[] color = { "颜色", "运动", "食物" };
public static String[] plant = { "植物", "动物", "人" };

public static String[][] school2= {
{ "初中一年级", "初中二年级", "初中三年级"}, {"高中一年级", "高中二年级",
"高中三年级"}, {"大学一年级", "大学二年级", "大学三年级", "大学四年级&