当前位置: 技术问答>java相关
请教各位大侠如何在JTree树中得到各个节点显示出来的字串
来源: 互联网 发布时间:2015-06-22
本文导语: 请教各位大侠如何在JTree树中得到各个节点显示出来的字串 | package test; import java.awt.*; import com.borland.jbcl.layout.*; import javax.swing.*; import javax.swing.tree.*; import javax.swing.event.*; import java.awt.even...
请教各位大侠如何在JTree树中得到各个节点显示出来的字串
|
package test;
import java.awt.*;
import com.borland.jbcl.layout.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.util.Vector;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2002
* Company:
* @author
* @version 1.0
*/
public class Frame1 extends JFrame {
XYLayout xYLayout1 = new XYLayout();
JComboBox jComboBox1 = new JComboBox();
JTextField jTextField1 = new JTextField();
Vector vecL=new Vector();
JTree jTree1;// = new JTree();
DefaultMutableTreeNode root;
public Frame1() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(xYLayout1);
/* for(int i=0;i
import java.awt.*;
import com.borland.jbcl.layout.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.util.Vector;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2002
* Company:
* @author
* @version 1.0
*/
public class Frame1 extends JFrame {
XYLayout xYLayout1 = new XYLayout();
JComboBox jComboBox1 = new JComboBox();
JTextField jTextField1 = new JTextField();
Vector vecL=new Vector();
JTree jTree1;// = new JTree();
DefaultMutableTreeNode root;
public Frame1() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(xYLayout1);
/* for(int i=0;i