Links in JTree

Hi,
I'm working with JTree(using a DefaultCellRenderer to display my own image) and I want to know if it's possible to add a mouse listener to the image of a node. I mean, I want to click in the image of a node and make an action. Is that possible?
Thank you.
Happy new year!

Thank you for your answer guys. If I do the first thing I won't be able to add the image(actually, as he said, a subclass of JLabel) to the DefaultTreeCellRenderer. Or can I?
By the other hand, I tried the DefaultTreeCellRenderer's mouselistener but I didn't get anything. Can you explain me how to use it?
Thanks

Similar Messages

  • Linking two jtrees together

    Hello all,
    i want to link two elements in two JTrees
    so when i add a child to one of them at run time
    it will appear in the other too???
    thanks in advance.

    well then all you have to do is to make sure that you add the same "MutableTreeNode" object, (the element you want to link) into both models. adding a child to that node will then fire the update events to the view, i.e. the tree.

  • Setting JTree in one class file from another class file

    Hello,
    I'm new to java. I recently created a project in netbeans and here is one of the java files. I used the IDE to make a split pane, with a tree structure and panel in it.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * AmplifierDesignGUI.java
    * Created on Jun 20, 2010, 1:18:52 PM
    package AmplifierDesign;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    * @author Bugz
    public class AmplifierDesignGUI extends javax.swing.JFrame {
    /** Creates new form AmplifierDesignGUI */
    public AmplifierDesignGUI() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jSplitPane1 = new javax.swing.JSplitPane();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTree1 = new javax.swing.JTree();
    jPanel1 = new javax.swing.JPanel();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    jMenu2 = new javax.swing.JMenu();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jScrollPane1.setViewportView(jTree1);
    jSplitPane1.setLeftComponent(jScrollPane1);
    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(0, 475, Short.MAX_VALUE)
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(0, 274, Short.MAX_VALUE)
    jSplitPane1.setRightComponent(jPanel1);
    jMenu1.setText("File");
    jMenuBar1.add(jMenu1);
    jMenu2.setText("Edit");
    jMenuBar1.add(jMenu2);
    setJMenuBar(jMenuBar1);
    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .add(8, 8, 8)
    .add(jSplitPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 571, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(32, Short.MAX_VALUE))
    layout.setVerticalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .add(8, 8, 8)
    .add(jSplitPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 278, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    pack();
    }// </editor-fold>
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new AmplifierDesignGUI().setVisible(true);
    try {
    new JTreeStructure().setVisible(true);
    } catch (Exception ex) {
    Logger.getLogger(AmplifierDesignGUI.class.getName()).log(Level.SEVERE, null, ex);
    // Variables declaration - do not modify
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTree jTree1;
    // End of variables declaration
    So once this was done I wanted to link the JTree to a mysql database. So I found a sample .java file on the net:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package AmplifierDesign;
    import java.awt.*;
    import java.sql.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class JTreeStructure extends JFrame {
    Connection con = null;
    Statement st = null;
    ResultSet rs = null;
    //public static void main(String args[]) throws Exception {
    // new JTreeStructure();
    public JTreeStructure() throws Exception {
    super("Retrieving data from database ");
    String driver = "com.mysql.jdbc.Driver";
    String url = "jdbc:mysql://localhost:8889/";
    String db = "icons";
    ArrayList list = new ArrayList();
    list.add("Laser Objects");
    Class.forName(driver);
    con = DriverManager.getConnection(url + db, "root", "root");
    try {
    String sql = "Select * from fiberComponents";
    st = con.createStatement();
    rs = st.executeQuery(sql);
    while (rs.next()) {
    Object value[] = {"Fiber Components",rs.getString(2) };
    list.add(value);
    } catch (Exception e) {
    System.out.println(e);
    rs.close();
    st.close();
    con.close();
    Object hierarchy[] = list.toArray();
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    DefaultMutableTreeNode root = processHierarchy(hierarchy);
    JTree tree = new JTree(root);
    content.add(new JScrollPane(tree), BorderLayout.CENTER);
    setSize(275, 300);
    setLocation(300, 100);
    setVisible(true);
    private DefaultMutableTreeNode processHierarchy(Object[] hierarchy) {
    DefaultMutableTreeNode node = new DefaultMutableTreeNode(hierarchy[0]);
    DefaultMutableTreeNode child;
    for (int i = 1; i < hierarchy.length; i++) {
    Object nodeSpecifier = hierarchy;
    if (nodeSpecifier instanceof Object[]) // Ie node with children
    child = processHierarchy((Object[]) nodeSpecifier);
    } else {
    child = new DefaultMutableTreeNode(nodeSpecifier); // Ie Leaf
    node.add(child);
    return (node);
    The problem is when I run my program two windows open up. The original one with JTree1, and the panel and horizontal splitplane and another window with a new tree component that did get its objects from the database. My question is how do I "replace" the JTree1 with the new tree created from the second java file?
    Or additionally, maybe I could set the data for JTree1 from within the second java file?

    zmoddynamics wrote:
    ....Please excuse my post as I am not sure what is meant by code tags?To use code tags, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.
    Another way to do this is to manually place the tags into your code by placing the tag [cod&#101;] above your pasted code and the tag [cod&#101;] below your pasted code like so:
    [cod&#101;]
      // your code goes here
      // notice how the top and bottom tags are different
    [/cod&#101;]Luck.

  • JTree - background color

    hello,
    iam trying to set the backgroung color of my tree, i tried using tree.setBackground(Color.gray) but it did not work, i checked out the documentation but it did not specify how to do that, please can someone help?
    asrar

    ah i finally got the solution, thanx ttarola for the renderer tip coz that did the trick, here is how i did it:
         DefaultMutableTreeNode top = new DefaultMutableTreeNode("Links");
         DefaultTreeCellRenderer linksRenderer = new DefaultTreeCellRenderer();
            createNodes(top);
            links = new JTree(top);
            links.putClientProperty("JTree.lineStyle", "Angled");
            linksRenderer.setBackgroundNonSelectionColor(Color.gray);//this did the trick
            linksRenderer.setBackgroundSelectionColor(Color.gray);
            linksRenderer.setLeafIcon(new ImageIcon("middle.gif"));
            links.setCellRenderer(linksRenderer);
            linkScroller = new JScrollPane(links);thanx guys for the suggestions and help.
    asrar

  • Display a Linked List ADT in JTree ?

    Most of the Swing examples that I have noticed for building a JTree have used many different ADTs, but I haven't noticed any examples to use a JTree to display a linked list (not necessarily the LinkedList class though). I was studying Data Structures & Algorithms, and the majority of the examples for Binary Trees, Red-Black Trees, and 2-3-4 Trees use a form of a linked list to connect all of the nodes together.
    Isn't it, or should it, be possible to use a JTree to display a linked list ADT ? Or am I missing something somewhere ?

    Maybe, if you only had a reference to one other node in the object that is being linked together.
    What if there was a node object that contained three references ?
    nextNode
    prevNode
    subNode

  • Link JTree to object

    hi. can i link one object to Jtree?? i will create my own object and want to link with my JTree, so if i click one node in my JTree i want to change some properties on my Object..
    tks

    Hi Thomas,
    It is possible to link objects to operations through Object link functionality...
    Pls refer my earlier answered thread  Re: PM Order - Functional Location and Equipments on Operations
    This may help.
    Thanks
    Siva

  • Please tell me some link of good advance practice code on JTable&JTree

    Hi, I am learning swing and developing a project .I read the sun document .Can u tell me some good link of learning the advace JTree&JTable . I want more expose in this area.
    Thanks in advance,
    anum

    [url http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]The Swing Tutorial

  • Link a buddy list into a JTree

    I want to load a list of user into a JTree. Would hashMAP be suitable?
    The scanario is an instant messenger. I have a method that reads the profile of user, that then I can pass that list to a certain compont. Would I be able to write a Hashmap to link the buddy list in the JTree?
    Does anyone have some example of this in use? Maybe something similar
    Thanks Dilip

    You need a one-to-many mapping so you can use a HashMap where the values are Lists.
    I'm not sure what you are asking about JTree, though.

  • JTree Node URL Link

    Hi,
    Problem:
    I have an applet with a number of tabbed panes, each pane includes a tree. I'm trying to get so that a file in the tree opens its URL link in the _parent browser which the applet was loader from.
    Cheers

    I've done this, except opening the URL in another frame instead (so as not to dispose of the JTree).
    You need to create a class to store the title and url of the file. You then add an instance of this class to your DefaultMutableTreeNode using the setUserObject method.
    Add a MouseListener to your applet, it might look like this...
    public void mouseClicked(MouseEvent me) {
      if(me.getClickCount() == 2) {
        MyTreeNode node = (MyTreeNode)myTree.getLastSelectedPathComponent();
        if(node != null) {
          NodeRecord file = (NodeRecord)node.getUserObject();
          try {
            this.getAppletContext().showDocument(new URL(file.getUrl()), "_parent");
          } catch (Exception ee) {
    }You will need to create the NodeRecord class which stores the title, url and has the getUrl method. MyTreeNode is my own implementation of the DefaultMutableTreeNode.
    Hope this gets you moving.
    Rob.

  • How can I manage multiple JTrees by establishing a link between them?

    Hi guys,
    I have a program that load 2 JTree in a separate panel by JSplitPane.
    Now what I want to do is that if I click on a node in one of these trees in one SplitPane, I want the other tree to do something correspondingly in another SplitPane.
    I know I can make the game big as 2 threads, but I try to solve it in a minimum solution.
    Is there any hints and examples?
    Thanks
    Michael

    Hi, again,
    I have 2 JTree objects. I wrote a JTree node selection listener extends the MouseAdaptor to respond to mouse click in my first JTree object.
    The listener works fine and can return me what I need, for example return me the node I clicked and some associated nodes which located in my second tree.These 2 trees locate in separating splitPane in a GUI window.
    My idea is let the second tree be updated spontaneously upone the clicking in my first JTree node..How could I inform the second tree about my mouse event in the first tree?
    Thanks to your replies.

  • JTree-Renderer Panels - any good link?

    Hello again
    I am really stuck please could anybody give me a good link where TreeCellRenderer are good explained. I've posted already a topic but it seems nobody can help.
    I want to put JPanels as nodes where each Jpanel displays a model of permissions with checkboxes.
    Thank you very much.

    Hello again
    I am really stuck please could anybody give me a good link where TreeCellRenderer are good explained. I've posted already a topic but it seems nobody can help.
    I want to put JPanels as nodes where each Jpanel displays a model of permissions with checkboxes.
    Thank you very much.

  • Problem with JPopupMenu and JTree

    Hi,
    Is there any way to have different JPopupMenu for every node.
    When I right click on the treenode there is popup menu have a "*JCheckBoxMenuItem*". By default the value of that checkbox is false. Now when i try to right click on a particular node and select the checkbox the selected value gets applied to rest of all nodes also.
    How can i just set the value of the checkbox to one perticular node.
    my code is
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class TreePopupMenuTest {
      public JComponent makeUI() {
        JTree tree = new JTree();
        tree.setComponentPopupMenu(new TreePopupMenu());
        JPanel p = new JPanel(new BorderLayout());
        p.add(new JScrollPane(tree));
        p.setPreferredSize(new Dimension(320, 240));
        return p;
      class TreePopupMenu extends JPopupMenu {
        private TreePath path;
        private JCheckBoxMenuItem compress=new JCheckBoxMenuItem("Compress");
        public TreePopupMenu() {
          super();
          add(compress);
          compress.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ie) {
                            if(compress.getState()){
                                 compress.setState(true);
                                    System.out.println("compress clicked");
                            else{
                                 compress.setState(false);
                                    System.out.println("uncompress");
        public void show(Component c, int x, int y) {
          JTree tree = (JTree)c;
          path = tree.getPathForLocation(x, y);
          if(path!=null && path==tree.getAnchorSelectionPath()) {
            super.show(c, x, y);
      public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
          public void run() { createAndShowGUI(); }
      public static void createAndShowGUI() {
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        f.getContentPane().add(new TreePopupMenuTest().makeUI());
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    }Please help me as soon as possible.
    Thanks.
    Edited by: Kavita_S on Apr 23, 2009 11:49 PM

    Hi,
    Do you know this link?
    [How to Use Trees|http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html]
    Please help me as soon as possible.Sorry that I'm not good at English, I don't understand what you mean.
    Anyway, here's a quick example:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class TreePopupMenuTest3 {
      public JComponent makeUI() {
        JTree tree = new JTree();
        tree.setComponentPopupMenu(new TreePopupMenu());
        JPanel p = new JPanel(new BorderLayout());
        p.add(new JScrollPane(tree));
        p.setPreferredSize(new Dimension(320, 240));
        return p;
      class TreePopupMenu extends JPopupMenu {
        private TreePath path;
        private JCheckBoxMenuItem compress = new JCheckBoxMenuItem("Compress");
        public TreePopupMenu() {
          super();
          add(compress);
          compress.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ie) {
              if (compress.getState()) {
                System.out.println("compress clicked");
                setSelectedPath(path, true);
              } else {
                System.out.println("uncompress");
                setSelectedPath(path, false);
        public void show(Component c, int x, int y) {
          JTree tree = (JTree)c;
          path = tree.getPathForLocation(x, y);
          if (path!=null && path==tree.getAnchorSelectionPath()) {
            compress.setState(isSelectedPath(path));
            super.show(c, x, y);
      class MyData {
        public boolean flag;
        public String name;
        public MyData(String name, boolean flag) {
          this.name = name;
          this.flag = flag;
        @Override public String toString() {
          return name;
      //private Set<TreePath> selectedPath = new HashSet<TreePath>();
      private void setSelectedPath(TreePath p, boolean flag) {
        //if (flag) selectedPath.add(p);
        //else    selectedPath.remove(p);
        DefaultMutableTreeNode node =
              (DefaultMutableTreeNode)p.getLastPathComponent();
        Object o = node.getUserObject();
        if (o instanceof MyData) {
          ((MyData)o).flag = flag;
        } else {
          node.setUserObject(new MyData(o.toString(), flag));
      private boolean isSelectedPath(TreePath p) {
        //return selectedPath.contains(p);
        Object o =
              ((DefaultMutableTreeNode)p.getLastPathComponent()).getUserObject();
        return (o instanceof MyData)?((MyData)o).flag:false;
      public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
          public void run() {
            createAndShowGUI();
      public static void createAndShowGUI() {
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        f.getContentPane().add(new TreePopupMenuTest3().makeUI());
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    }

  • How to load a directory in JTree with Children(On expansion)

    Hi,
    How can I load a Jtree directory with children on expanding the node of that directory.
    I have developed the following SSCCE. Please explain in its context.
    My specific question is, when you execute the code given here, you can see the file bb.1 inside the directory bb.
    bb.1 is a dummy which I used while creating the Jtree. When I expand bb, instead of the leaf bb.1 , I want to display some other file name, say qq.1 or jj.1.
    What should I do?
    Hope my question is clear(http://forums.sun.com/thread.jspa?threadID=5337544&start=20&tstart=0 -- please ignore the given link).
    //FileTreeFrame.java
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.JFrame;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    public class FileTreeFrame extends JFrame {
      private JTree fileTree;
      private FileSystemModel fileSystemModel;
      public FileTreeFrame(String abc) {
        super("JTree FileSystem Viewer");
        // Build up your data
        List rootChildren = new ArrayList();
        rootChildren.add( new MyNode("aa") );
        List bbChildren = new ArrayList();
        bbChildren.add( new MyNode("bb.1") );
        rootChildren.add( new MyNode("bb", bbChildren) );
        rootChildren.add( new MyNode("cc") );
        MyNode rootNode = new MyNode("root", rootChildren);
        fileTree = new JTree(new FileSystemModel(new MyTreeNode(rootNode)));
        fileTree.setRootVisible(false);
        fileTree.setShowsRootHandles(true);
        getContentPane().add(fileTree);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(640, 480);
        setVisible(true);
      public static void main(String args[]) {
        new FileTreeFrame("");
    class FileSystemModel extends DefaultTreeModel {
        public FileSystemModel(DefaultMutableTreeNode node) {
              super(node);
        public boolean isLeaf(Object node) {
              MyTreeNode treeNode = (MyTreeNode)node;
              return !((MyNode)treeNode.getUserObject()).hasChildren();
    =======================================================
    //MyNode.java
    import java.util.List;
    public class MyNode {
          private String name;
          private List children;
          public MyNode(String name) {
                this.name = name;
          public MyNode(String name, List children) {
                this.name = name;
                this.children = children;
          public boolean hasChildren() {
                return children!=null && children.size()>0;
          public String toString() {
                return name;
          public List getChildren() {
                return children;
    =========================================================
    //MyTreeNode.java
    import java.util.Iterator;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class MyTreeNode extends DefaultMutableTreeNode {
        public MyTreeNode(MyNode node) {
            super(node);
            addSubNodes();
        private void addSubNodes() {
              MyNode content = (MyNode)getUserObject();
              if (content!=null && content.hasChildren()) {
                    for (Iterator it = content.getChildren().iterator(); it.hasNext();) {
                          add( new MyTreeNode((MyNode)it.next()) );
    }

    I believe JFileChooser has a method setFileSelectionMode() which will allow you to do this. You can configure the chooser to allow selection of FILES_ONLY, DIRECTORIES_ONLY or FILES_AND_DIRECTORIES.
    I have not used this myself but understand it will achieve what you need.

  • Urgent help needed in JTree

    Hi,
    Using Graphics2D when I rotate my JTree I want the event associated with the component also to move along with the coordinates of the component.
    In Event class there is one method translate(int x, int y) can anyone tell me how to implement this method in my program. A simple example will be of great use.
    Or whatever way u have pls suggest.
    regards

    I have resolved your problem and build a sample application.
    You have to create 2 views and use master detail.
    First view will be a simple view for the page 1 and second view will be readonly using group by. Then create a view link between them.
    Let me know your email id. I will email you the sample application.
    SID
    Edited by: manieshsailoz on Apr 26, 2010 5:12 PM

  • JTree, displaying data from a database

    Hi, im doing an application that will display the listing of courses, and allow users to book them. For the display of courses, i plan to use JTree to display them.
    However my problem arises from fetchin data and putting them into the tree.
    This file connects to the database and fetch the 'Course Category' and puts it in an Array.
    public ArrayList<CourseCategory> getCategory() {
    ArrayList<CourseCategory> categoryArray = new ArrayList();
    try {
    String statement = "SELECT * FROM Category";
    rs = stmt.executeQuery(statement);
    while (rs.next()) {
    CourseCategory cc = new CourseCategory();
    cc.setCategoryID(rs.getInt("CategoryID"));
    cc.setCategoryName(rs.getString("CategoryName"));
    categoryArray.add(cc);
    rs.close();
    stmt.close();
    con.close();
    catch (Exception e) {
    //catch exception     }
    return categoryArray;
    CourseCategory File has the necessary accessor methods, and a toString method to display out the category name.
    The main file, which has the JTree
    public DisplayCoursesGUI() {
    try {
    courseDB = new CourseDB();
    courseDB.getCategory();
    catch (Exception e) {
    //catch exception }
    DefaultMutableTreeNode top = new DefaultMutableTreeNode("");
    for (int i=0;i<courseDB.test2().size();i++) {
    category = new DefaultMutableTreeNode(courseDB.getCategory());
    top.add(category);
    Codes for JTrees as follows.
    I have the output of
    e.g.
    [MICROSOFT OFFICE APPLICATIONS, WEB APPLICATIONS] repeated twice in the tree. Im hoping to achieve the following effects
    e.g.
    -MICROSOFT OFFICE APPLICATIONS
    ----Microsoft Word
    ----Microsoft Powerpoint
    -WEB APPLICATIONS
    -----Adobe Photoshop
    I have 2 MS Access Table.[Category]ID, CategoryName. [COURSE]ID,CourseName,CategoryID. They have a relationship.
    How do I modify my codes to get what i hope to achieve? Help really appreciated.
    Thank you!!

    Hi,
    If you read my first post, I wanted to achieve this effect.
    ----CategoryName1
    ----------SubCategoryItem1
    ----CategoryName2
    ----------SubCategoryItem2
    My Table Structure.
    CATEGORY TABLE
    ID (autonumber), Name(string)
    COURSES TABLE
    ID(autonumber),Name(string), CategoryID(int)(A Relationship is link to Category Table-ID)
    I have managed to retrieve the items from the Category Table into a result set, and I have added the result set into an Array (See 1st post)
    Now, the problem comes when im tryin to do a for loop to display out the categorynames from the array(see 1st post again).
    Now my array prints out as follows
    e.g.
    [CategoryName1,CategoryName2]
    And if i put a for look into my application to display a JTREE,
    My end results is
    ------[CategoryName1, CategoryName2]
    ------[CategoryName1, CategoryName2]
    How should I ammend my codes to get:
    -------CategoryName1
    -------CategoryName2

Maybe you are looking for

  • MB5B report having discrepancies in stock

    Dear All, I have checked the stock balance using MB5B for date 07.04.2009. The system while executing the transaction gives a warning message saying u201CFI document summarization is active / the results may be incorrect But on 31.03.2009 in MB5B sto

  • Opening a web page created through Dreamweaver

    Is there any way I can open in iWeb and then save a web page I created using another application; in this case, Dreamweaver? Or would I have to duplicate that page in iWeb from the ground up?

  • Condition type EK02 and VPRS.

    Hi Everyone, In our pricing procedure there are two condition types EK02 and VPRS at header level. The profit margin we are getting is in negative. Can any one through some light about the use of EK02 and VPRS condition types and how system picks the

  • BinaryEncoded variable objectGUID  please help

    I have saved the binaryEncoded variable objectGUID  from a  <cfldap result in a Hex format which is a string like so:  EFD456E418BAC6468F6875A136FFE581 its worth noting that toString(binaryDecode('EFD456E418BAC6468F6875A136FFE581','HEX')) gives me ��

  • PO Error : Deliv. date outside period covered by factory calendar

    Hi, We are encountering an error "Deliv. date outside period covered by factory calendar xx" when creating a PO. I checked the delivery date of the item and it is : 11/30/2009. The Factory calendar valid from/to year is 2005-2013. What may have cause