Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2010
    Location
    India
    Posts
    4
    Rep Power
    0

    Unhappy How can i create XML file from JTree ? :: Need ur valuable Suggestions.

    How can i create XML file from JTree ? :: Need ur valuable Suggestions.
    Hello friends,

    I am King here. I am new to Java Swing programming.

    I got new task in my company. Here, i need to generate a dynamic XML file from Editable JTree.

    I have successfully coded for editable JTree. In this tree we can add and delete new nodes. Means, the number of elements will vary from user to user. User will create their own customized tree according to their requirements.

    If they click on GenerateXML, we need to generate an XML file according to the tree structure. I am new to swing programming. So, can any one help me for this please............

    my Existing code is as follows:

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    /**
    *
    * @author King Kranthi
    */

    package xmlapp.examples;

    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Enumeration;

    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.MutableTreeNode;
    import javax.swing.tree.TreeNode;
    import javax.swing.tree.TreePath;

    public class EditableTree extends JFrame {

    private DefaultMutableTreeNode m_rootNode = new DefaultMutableTreeNode("new");

    private DefaultTreeModel m_model = new DefaultTreeModel(m_rootNode);

    private JTree m_tree = new JTree(m_model);

    private JButton m_addButton = new JButton("Add Node");

    private JButton m_delButton = new JButton("Delete Node");

    private JButton m_xmlButton = new JButton("Generate XML");

    private JButton m_searchButton = new JButton("Search Node");

    private JButton m_searchAndDeleteButton = new JButton("Search and Delete Node");

    private JTextField m_searchText;

    public EditableTree() {

    m_tree.setEditable(true);
    m_tree.setSelectionRow(0);

    JScrollPane scrollPane = new JScrollPane(m_tree);
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    JPanel panel = new JPanel();

    m_addButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    DefaultMutableTreeNode selNode = (DefaultMutableTreeNode) m_tree
    .getLastSelectedPathComponent();
    if (selNode == null) {
    return;
    }
    DefaultMutableTreeNode newNode = new DefaultMutableTreeNode("new");
    m_model.insertNodeInto(newNode, selNode, selNode.getChildCount());

    TreeNode[] nodes = m_model.getPathToRoot(newNode);
    TreePath path = new TreePath(nodes);
    m_tree.scrollPathToVisible(path);
    m_tree.setSelectionPath(path);
    m_tree.startEditingAtPath(path);
    }
    });
    panel.add(m_addButton);

    m_delButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    DefaultMutableTreeNode selNode = (DefaultMutableTreeNode) m_tree
    .getLastSelectedPathComponent();
    removeNode(selNode);
    }
    });
    panel.add(m_delButton);

    m_xmlButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    DefaultMutableTreeNode selNode = (DefaultMutableTreeNode) m_tree
    .getLastSelectedPathComponent();
    generateXML();
    }
    });
    panel.add(m_xmlButton);

    JPanel searchPanel = new JPanel();
    searchPanel.setBorder(BorderFactory.createEtchedBo rder());

    m_searchText = new JTextField(10);
    searchPanel.add(m_searchText);

    m_searchButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    DefaultMutableTreeNode node = searchNode(m_searchText.getText());
    if (node != null) {
    TreeNode[] nodes = m_model.getPathToRoot(node);
    TreePath path = new TreePath(nodes);
    m_tree.scrollPathToVisible(path);
    m_tree.setSelectionPath(path);
    System.out.println(nodes.length);
    } else {
    System.out.println("Node with string '" + m_searchText.getText() + "' not found");
    }
    }
    });
    searchPanel.add(m_searchButton);

    m_searchAndDeleteButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    DefaultMutableTreeNode node = searchNode(m_searchText.getText());
    if (node != null) {
    removeNode(node);
    } else {
    System.out.println("Node with string '" + m_searchText.getText() + "' not found");
    }
    }
    });
    searchPanel.add(m_searchAndDeleteButton);
    panel.add(searchPanel);
    getContentPane().add(panel, BorderLayout.SOUTH);
    setSize(1000, 700);
    setVisible(true);
    }

    public DefaultMutableTreeNode searchNode(String nodeStr) {
    DefaultMutableTreeNode node = null;
    Enumeration e = m_rootNode.breadthFirstEnumeration();
    while (e.hasMoreElements()) {
    node = (DefaultMutableTreeNode) e.nextElement();
    if (nodeStr.equals(node.getUserObject().toString())) {
    System.out.println("==>"+node);
    return node;
    }
    }
    return null;
    }

    public void removeNode(DefaultMutableTreeNode selNode) {
    if (selNode == null) {
    return;
    }
    MutableTreeNode parent = (MutableTreeNode) (selNode.getParent());
    if (parent == null) {
    return;
    }
    MutableTreeNode toBeSelNode = getSibling(selNode);
    if (toBeSelNode == null) {
    toBeSelNode = parent;
    }
    TreeNode[] nodes = m_model.getPathToRoot(toBeSelNode);
    TreePath path = new TreePath(nodes);
    m_tree.scrollPathToVisible(path);
    m_tree.setSelectionPath(path);
    m_model.removeNodeFromParent(selNode);
    }

    private MutableTreeNode getSibling(DefaultMutableTreeNode selNode) {
    MutableTreeNode sibling = (MutableTreeNode) selNode.getPreviousSibling();
    if (sibling == null) {
    sibling = (MutableTreeNode) selNode.getNextSibling();
    }
    return sibling;
    }

    public void generateXML(){
    DefaultMutableTreeNode node = null;
    //Enumeration e = m_rootNode.breadthFirstEnumeration(); //BFS
    int e = m_rootNode.getChildCount();
    System.out.println(e);
    }

    public static void main(String[] arg) {
    EditableTree editableTree = new EditableTree();
    }
    }

  2. #2
    beamall is offline Member
    Join Date
    Jun 2011
    Posts
    1
    Rep Power
    0

    Default

    Hi kranthipoturaju,

    Did you able to create xml from Jtree? If yes, I need same help!

    Thanks
    Beamall

  3. #3
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by kranthipoturaju View Post
    How can i create XML file from JTree ? :: Need ur valuable Suggestions.
    I just made a test with your code and xstream which allow you to generate xml code from any kind of java object. inside the jtree the structure looks like:

    Java Code:
    Root
       Node1
          Child11
          Child12
       Node2
          Child21
          Child22
    and here is the code xstream generate. it looks like a huge but each property from the object m_tree is stored. the advantage is that you can read the following xml as string and then cast it to a jtree with a simple (JTree)yourString. depending on how you want to use the generated xml xstream my be valuable.

    Java Code:
    <javax.swing.JTree serialization="custom">
      <java.awt.Component>
        <default>
          <boundsOp>3</boundsOp>
          <componentSerializedDataVersion>4</componentSerializedDataVersion>
          <enabled>true</enabled>
          <eventMask>4104</eventMask>
          <focusTraversalKeysEnabled>true</focusTraversalKeysEnabled>
          <focusable>true</focusable>
          <height>610</height>
          <ignoreRepaint>false</ignoreRepaint>
          <isFocusTraversableOverridden>1</isFocusTraversableOverridden>
          <isPacked>false</isPacked>
          <maxSizeSet>false</maxSizeSet>
          <minSizeSet>false</minSizeSet>
          <nameExplicitlySet>false</nameExplicitlySet>
          <newEventsOnly>true</newEventsOnly>
          <prefSizeSet>false</prefSizeSet>
          <valid>false</valid>
          <visible>true</visible>
          <width>989</width>
          <x>0</x>
          <y>0</y>
          <background class="javax.swing.plaf.ColorUIResource">
            <value>-1</value>
            <falpha>0.0</falpha>
          </background>
          <changeSupport serialization="custom">
            <java.beans.PropertyChangeSupport>
              <default>
                <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
                <source class="javax.swing.JTree" reference="../../../../../.."/>
              </default>
              <null/>
            </java.beans.PropertyChangeSupport>
          </changeSupport>
          <font class="javax.swing.plaf.FontUIResource">
            <attributes>
              <entry>
                <awt-text-attribute>posture</awt-text-attribute>
                <null/>
              </entry>
              <entry>
                <awt-text-attribute>width</awt-text-attribute>
                <null/>
              </entry>
              <entry>
                <awt-text-attribute>tracking</awt-text-attribute>
                <null/>
              </entry>
              <entry>
                <awt-text-attribute>superscript</awt-text-attribute>
                <null/>
              </entry>
              <entry>
                <awt-text-attribute>family</awt-text-attribute>
                <string>Dialog</string>
              </entry>
              <entry>
                <awt-text-attribute>transform</awt-text-attribute>
                <null/>
              </entry>
              <entry>
                <awt-text-attribute>weight</awt-text-attribute>
                <null/>
              </entry>
              <entry>
                <awt-text-attribute>size</awt-text-attribute>
                <null/>
              </entry>
            </attributes>
          </font>
          <locale>de_CH</locale>
          <peerFont class="javax.swing.plaf.FontUIResource" reference="../font"/>
        </default>
        <string>componentL</string>
        <javax.swing.JViewport_-ViewListener>
          <outer-class serialization="custom">
            <java.awt.Component>
              <default>
                <boundsOp>3</boundsOp>
                <componentSerializedDataVersion>4</componentSerializedDataVersion>
                <enabled>true</enabled>
                <eventMask>4104</eventMask>
                <focusTraversalKeysEnabled>true</focusTraversalKeysEnabled>
                <focusable>true</focusable>
                <height>610</height>
                <ignoreRepaint>false</ignoreRepaint>
                <isFocusTraversableOverridden>1</isFocusTraversableOverridden>
                <isPacked>false</isPacked>
                <maxSizeSet>false</maxSizeSet>
                <minSizeSet>false</minSizeSet>
                <nameExplicitlySet>false</nameExplicitlySet>
                <newEventsOnly>true</newEventsOnly>
                <prefSizeSet>false</prefSizeSet>
                <valid>false</valid>
                <visible>true</visible>
                <width>989</width>
                <x>1</x>
                <y>1</y>
                <background class="javax.swing.plaf.ColorUIResource">
                  <value>-1118482</value>
                  <falpha>0.0</falpha>
                </background>
                <font class="javax.swing.plaf.FontUIResource">
                  <attributes>
                    <entry>
                      <awt-text-attribute>posture</awt-text-attribute>
                      <null/>
                    </entry>
                    <entry>
                      <awt-text-attribute>width</awt-text-attribute>
                      <null/>
                    </entry>
                    <entry>
                      <awt-text-attribute>tracking</awt-text-attribute>
                      <null/>
                    </entry>
                    <entry>
                      <awt-text-attribute>superscript</awt-text-attribute>
                      <null/>
                    </entry>
                    <entry>
                      <awt-text-attribute>family</awt-text-attribute>
                      <string>Dialog</string>
                    </entry>
                    <entry>
                      <awt-text-attribute>transform</awt-text-attribute>
                      <null/>
                    </entry>
                    <entry>
                      <awt-text-attribute>weight</awt-text-attribute>
                      <null/>
                    </entry>
                    <entry>
                      <awt-text-attribute>size</awt-text-attribute>
                      <null/>
                    </entry>
                  </attributes>
                </font>
                <foreground class="sun.swing.PrintColorUIResource" resolves-to="javax.swing.plaf.ColorUIResource">
                  <value>-13421773</value>
                  <falpha>0.0</falpha>
                </foreground>
                <locale reference="../../../../../default/locale"/>
                <peerFont class="javax.swing.plaf.FontUIResource" reference="../font"/>
              </default>
              <null/>
              <java.awt.ComponentOrientation>
                <orientation>7</orientation>
              </java.awt.ComponentOrientation>
              <null/>
              <null/>
            </java.awt.Component>
            <java.awt.Container>
              <default>
                <ncomponents>1</ncomponents>
                <component>
                  <javax.swing.JTree reference="../../../../../../.."/>
                </component>
                <layoutMgr class="javax.swing.ViewportLayout"/>
                <focusCycleRoot>false</focusCycleRoot>
                <containerSerializedDataVersion>1</containerSerializedDataVersion>
                <focusTraversalPolicyProvider>false</focusTraversalPolicyProvider>
              </default>
              <null/>
              <null/>
            </java.awt.Container>
            <javax.swing.JComponent>
              <default>
                <alignmentX>0.0</alignmentX>
                <alignmentY>0.0</alignmentY>
                <autoscrolls>false</autoscrolls>
                <flags>25198600</flags>
                <isAlignmentXSet>false</isAlignmentXSet>
                <isAlignmentYSet>false</isAlignmentYSet>
                <verifyInputWhenFocusTarget>true</verifyInputWhenFocusTarget>
                <listenerList serialization="custom">
                  <javax.swing.event.EventListenerList>
                    <default/>
                    <null/>
                  </javax.swing.event.EventListenerList>
                </listenerList>
              </default>
              <int>0</int>
            </javax.swing.JComponent>
            <javax.swing.JViewport>
              <default>
                <backingStore>false</backingStore>
                <hasHadValidView>true</hasHadValidView>
                <isViewSizeSet>true</isViewSizeSet>
                <scrollMode>1</scrollMode>
                <scrollUnderway>false</scrollUnderway>
                <lastPaintPosition>
                  <x>0</x>
                  <y>0</y>
                </lastPaintPosition>
                <viewListener class="javax.swing.JViewport$ViewListener" reference="../../../.."/>
              </default>
            </javax.swing.JViewport>
          </outer-class>
        </javax.swing.JViewport_-ViewListener>
        <null/>
        <java.awt.ComponentOrientation reference="../javax.swing.JViewport_-ViewListener/outer-class/java.awt.Component/java.awt.ComponentOrientation"/>
        <null/>
        <null/>
      </java.awt.Component>
      <java.awt.Container>
        <default>
          <ncomponents>0</ncomponents>
          <component/>
          <focusCycleRoot>false</focusCycleRoot>
          <containerSerializedDataVersion>1</containerSerializedDataVersion>
          <focusTraversalPolicyProvider>false</focusTraversalPolicyProvider>
        </default>
        <null/>
        <null/>
      </java.awt.Container>
      <javax.swing.JComponent>
        <default>
          <alignmentX>0.0</alignmentX>
          <alignmentY>0.0</alignmentY>
          <autoscrolls>false</autoscrolls>
          <flags>16793960</flags>
          <isAlignmentXSet>false</isAlignmentXSet>
          <isAlignmentYSet>false</isAlignmentYSet>
          <verifyInputWhenFocusTarget>true</verifyInputWhenFocusTarget>
          <actionMap serialization="custom">
            <javax.swing.ActionMap>
              <default/>
              <int>0</int>
            </javax.swing.ActionMap>
          </actionMap>
          <ancestorInputMap serialization="custom">
            <javax.swing.InputMap>
              <default/>
              <int>0</int>
            </javax.swing.InputMap>
          </ancestorInputMap>
          <focusInputMap serialization="custom">
            <javax.swing.InputMap>
              <default/>
              <int>0</int>
            </javax.swing.InputMap>
          </focusInputMap>
          <listenerList serialization="custom">
            <javax.swing.event.EventListenerList>
              <default/>
              <null/>
            </javax.swing.event.EventListenerList>
          </listenerList>
        </default>
        <int>0</int>
      </javax.swing.JComponent>
      <javax.swing.JTree>
        <default>
          <dragEnabled>false</dragEnabled>
          <editable>true</editable>
          <expandRow>-1</expandRow>
          <expandsSelectedPaths>true</expandsSelectedPaths>
          <invokesStopCellEditing>false</invokesStopCellEditing>
          <largeModel>false</largeModel>
          <rootVisible>true</rootVisible>
          <rowHeight>0</rowHeight>
          <rowHeightSet>false</rowHeightSet>
          <scrollsOnExpand>true</scrollsOnExpand>
          <scrollsOnExpandSet>false</scrollsOnExpandSet>
          <settingUI>false</settingUI>
          <showsRootHandles>false</showsRootHandles>
          <showsRootHandlesSet>false</showsRootHandlesSet>
          <toggleClickCount>2</toggleClickCount>
          <visibleRowCount>20</visibleRowCount>
          <anchorPath serialization="custom">
            <javax.swing.tree.TreePath>
              <default>
                <parentPath serialization="custom">
                  <javax.swing.tree.TreePath>
                    <default>
                      <parentPath serialization="custom">
                        <javax.swing.tree.TreePath>
                          <default/>
                          <vector>
                            <string>lastPathComponent</string>
                            <javax.swing.tree.DefaultMutableTreeNode serialization="custom">
                              <javax.swing.tree.DefaultMutableTreeNode>
                                <default>
                                  <allowsChildren>true</allowsChildren>
                                  <children>
                                    <javax.swing.tree.DefaultMutableTreeNode serialization="custom">
                                      <javax.swing.tree.DefaultMutableTreeNode>
                                        <default>
                                          <allowsChildren>true</allowsChildren>
                                          <children>
                                            <javax.swing.tree.DefaultMutableTreeNode serialization="custom">
                                              <javax.swing.tree.DefaultMutableTreeNode>
                                                <default>
                                                  <allowsChildren>true</allowsChildren>
                                                  <parent class="javax.swing.tree.DefaultMutableTreeNode" reference="../../../../../../.."/>
                                                </default>
                                                <object-array>
                                                  <string>userObject</string>
                                                  <string>Child11</string>
                                                </object-array>
                                              </javax.swing.tree.DefaultMutableTreeNode>
                                            </javax.swing.tree.DefaultMutableTreeNode>
                                            <javax.swing.tree.DefaultMutableTreeNode serialization="custom">
                                              <javax.swing.tree.DefaultMutableTreeNode>
                                                <default>
                                                  <allowsChildren>true</allowsChildren>
                                                  <parent class="javax.swing.tree.DefaultMutableTreeNode" reference="../../../../../../.."/>
                                                </default>
                                                <object-array>
                                                  <string>userObject</string>
                                                  <string>Child12</string>
                                                </object-array>
                                              </javax.swing.tree.DefaultMutableTreeNode>
                                            </javax.swing.tree.DefaultMutableTreeNode>
                                          </children>
                                          <parent class="javax.swing.tree.DefaultMutableTreeNode" reference="../../../../../../.."/>
                                        </default>
                                        <object-array>
                                          <string>userObject</string>
                                          <string>Node1</string>
                                        </object-array>
                                      </javax.swing.tree.DefaultMutableTreeNode>
                                    </javax.swing.tree.DefaultMutableTreeNode>
                                    <javax.swing.tree.DefaultMutableTreeNode serialization="custom">
                                      <javax.swing.tree.DefaultMutableTreeNode>
                                        <default>
                                          <allowsChildren>true</allowsChildren>
                                          <children>
                                            <javax.swing.tree.DefaultMutableTreeNode serialization="custom">
                                              <javax.swing.tree.DefaultMutableTreeNode>
                                                <default>
                                                  <allowsChildren>true</allowsChildren>
                                                  <parent class="javax.swing.tree.DefaultMutableTreeNode" reference="../../../../../../.."/>
                                                </default>
                                                <object-array>
                                                  <string>userObject</string>
                                                  <string>Child21</string>
                                                </object-array>
                                              </javax.swing.tree.DefaultMutableTreeNode>
                                            </javax.swing.tree.DefaultMutableTreeNode>
                                            <javax.swing.tree.DefaultMutableTreeNode serialization="custom">
                                              <javax.swing.tree.DefaultMutableTreeNode>
                                                <default>
                                                  <allowsChildren>true</allowsChildren>
                                                  <parent class="javax.swing.tree.DefaultMutableTreeNode" reference="../../../../../../.."/>
                                                </default>
                                                <object-array>
                                                  <string>userObject</string>
                                                  <string>Child22</string>
                                                </object-array>
                                              </javax.swing.tree.DefaultMutableTreeNode>
                                            </javax.swing.tree.DefaultMutableTreeNode>
                                          </children>
                                          <parent class="javax.swing.tree.DefaultMutableTreeNode" reference="../../../../../../.."/>
                                        </default>
                                        <object-array>
                                          <string>userObject</string>
                                          <string>Node2</string>
                                        </object-array>
                                      </javax.swing.tree.DefaultMutableTreeNode>
                                    </javax.swing.tree.DefaultMutableTreeNode>
                                  </children>
                                </default>
                                <object-array>
                                  <string>userObject</string>
                                  <string>Root</string>
                                </object-array>
                              </javax.swing.tree.DefaultMutableTreeNode>
                            </javax.swing.tree.DefaultMutableTreeNode>
                          </vector>
                        </javax.swing.tree.TreePath>
                      </parentPath>
                    </default>
                    <vector>
                      <string>lastPathComponent</string>
                      <javax.swing.tree.DefaultMutableTreeNode reference="../../default/parentPath/javax.swing.tree.TreePath/vector/javax.swing.tree.DefaultMutableTreeNode/javax.swing.tree.DefaultMutableTreeNode/default/children/javax.swing.tree.DefaultMutableTreeNode[2]"/>
                    </vector>
                  </javax.swing.tree.TreePath>
                </parentPath>
              </default>
              <vector>
                <string>lastPathComponent</string>
                <javax.swing.tree.DefaultMutableTreeNode reference="../../default/parentPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/vector/javax.swing.tree.DefaultMutableTreeNode/javax.swing.tree.DefaultMutableTreeNode/default/children/javax.swing.tree.DefaultMutableTreeNode[2]/javax.swing.tree.DefaultMutableTreeNode/default/children/javax.swing.tree.DefaultMutableTreeNode[2]"/>
              </vector>
            </javax.swing.tree.TreePath>
          </anchorPath>
          <dropMode>USE_SELECTION</dropMode>
          <leadPath reference="../anchorPath"/>
        </default>
        <vector>
          <string>treeModel</string>
          <javax.swing.tree.DefaultTreeModel serialization="custom">
            <javax.swing.tree.DefaultTreeModel>
              <default>
                <asksAllowsChildren>false</asksAllowsChildren>
                <listenerList serialization="custom">
                  <javax.swing.event.EventListenerList>
                    <default/>
                    <null/>
                  </javax.swing.event.EventListenerList>
                </listenerList>
                <root class="javax.swing.tree.DefaultMutableTreeNode" reference="../../../../../default/anchorPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/vector/javax.swing.tree.DefaultMutableTreeNode"/>
              </default>
              <vector>
                <string>root</string>
                <javax.swing.tree.DefaultMutableTreeNode reference="../../../../../default/anchorPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/vector/javax.swing.tree.DefaultMutableTreeNode"/>
              </vector>
            </javax.swing.tree.DefaultTreeModel>
          </javax.swing.tree.DefaultTreeModel>
          <string>selectionModel</string>
          <javax.swing.tree.DefaultTreeSelectionModel serialization="custom">
            <javax.swing.tree.DefaultTreeSelectionModel>
              <default>
                <leadIndex>0</leadIndex>
                <leadRow>-1</leadRow>
                <selectionMode>4</selectionMode>
                <changeSupport serialization="custom">
                  <java.beans.PropertyChangeSupport>
                    <default>
                      <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion>
                      <source class="javax.swing.tree.DefaultTreeSelectionModel" reference="../../../../../.."/>
                    </default>
                    <null/>
                  </java.beans.PropertyChangeSupport>
                  <javax.swing.event.SwingPropertyChangeSupport>
                    <default>
                      <notifyOnEDT>false</notifyOnEDT>
                    </default>
                  </javax.swing.event.SwingPropertyChangeSupport>
                </changeSupport>
                <lastPaths/>
                <leadPath serialization="custom">
                  <javax.swing.tree.TreePath>
                    <default>
                      <parentPath serialization="custom">
                        <javax.swing.tree.TreePath>
                          <default>
                            <parentPath serialization="custom">
                              <javax.swing.tree.TreePath>
                                <default/>
                                <vector>
                                  <string>lastPathComponent</string>
                                  <javax.swing.tree.DefaultMutableTreeNode reference="../../../../../../../../../../../../../../default/anchorPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/vector/javax.swing.tree.DefaultMutableTreeNode"/>
                                </vector>
                              </javax.swing.tree.TreePath>
                            </parentPath>
                          </default>
                          <vector>
                            <string>lastPathComponent</string>
                            <javax.swing.tree.DefaultMutableTreeNode reference="../../../../../../../../../../../default/anchorPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/vector/javax.swing.tree.DefaultMutableTreeNode/javax.swing.tree.DefaultMutableTreeNode/default/children/javax.swing.tree.DefaultMutableTreeNode[2]"/>
                          </vector>
                        </javax.swing.tree.TreePath>
                      </parentPath>
                    </default>
                    <vector>
                      <string>lastPathComponent</string>
                      <javax.swing.tree.DefaultMutableTreeNode reference="../../../../../../../../default/anchorPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/default/parentPath/javax.swing.tree.TreePath/vector/javax.swing.tree.DefaultMutableTreeNode/javax.swing.tree.DefaultMutableTreeNode/default/children/javax.swing.tree.DefaultMutableTreeNode[2]/javax.swing.tree.DefaultMutableTreeNode/default/children/javax.swing.tree.DefaultMutableTreeNode[2]"/>
                    </vector>
                  </javax.swing.tree.TreePath>
                </leadPath>
                <listSelectionModel>
                  <selectionMode>2</selectionMode>
                  <minIndex>2147483647</minIndex>
                  <maxIndex>-1</maxIndex>
                  <anchorIndex>7</anchorIndex>
                  <leadIndex>7</leadIndex>
                  <firstAdjustedIndex>2147483647</firstAdjustedIndex>
                  <lastAdjustedIndex>-1</lastAdjustedIndex>
                  <isAdjusting>false</isAdjusting>
                  <firstChangedIndex>2147483647</firstChangedIndex>
                  <lastChangedIndex>-1</lastChangedIndex>
                  <value></value>
                  <listenerList serialization="custom">
                    <javax.swing.event.EventListenerList>
                      <default/>
                      <null/>
                    </javax.swing.event.EventListenerList>
                  </listenerList>
                  <leadAnchorNotificationEnabled>true</leadAnchorNotificationEnabled>
                </listSelectionModel>
                <listenerList serialization="custom">
                  <javax.swing.event.EventListenerList>
                    <default/>
                    <string>javax.swing.event.TreeSelectionListener</string>
                    <javax.swing.JTree_-TreeSelectionRedirector>
                      <outer-class reference="../../../../../../../../.."/>
                    </javax.swing.JTree_-TreeSelectionRedirector>
                    <null/>
                  </javax.swing.event.EventListenerList>
                </listenerList>
                <selection>
                  <javax.swing.tree.TreePath reference="../../leadPath"/>
                </selection>
                <tempPaths>
                  <null/>
                </tempPaths>
                <uniquePaths>
                  <entry>
                    <javax.swing.tree.TreePath reference="../../../leadPath"/>
                    <boolean>true</boolean>
                  </entry>
                </uniquePaths>
              </default>
              <object-array/>
            </javax.swing.tree.DefaultTreeSelectionModel>
          </javax.swing.tree.DefaultTreeSelectionModel>
          <string>expandedState</string>
          <vector>
            <int-array>
              <int>1</int>
            </int-array>
            <boolean>true</boolean>
            <int-array/>
            <boolean>true</boolean>
            <int-array>
              <int>0</int>
            </int-array>
            <boolean>true</boolean>
          </vector>
        </vector>
      </javax.swing.JTree>
    </javax.swing.JTree>

Similar Threads

  1. Replies: 0
    Last Post: 02-25-2010, 06:49 AM
  2. Mbox File and JTree Problem.
    By dracuswolf in forum AWT / Swing
    Replies: 1
    Last Post: 07-26-2009, 06:17 AM
  3. Move JTree item to another JTree.
    By Melki in forum AWT / Swing
    Replies: 8
    Last Post: 07-09-2009, 12:59 PM
  4. How to display a file system in a JTree view
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-27-2008, 08:43 PM
  5. Replies: 7
    Last Post: 05-09-2008, 08:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •