Swing tree updates

Hi,
I wrote a swing tree applet that gets notified by a server when to add new nodes to the tree and who the new node's parent is. I can find the parent node and insert the new node into the tree fine. The problem is when my program first starts I receive all the new nodes sequentially about two seconds apart. The tree looks all wacky as the nodes are being added. I'm not sure of the proper method of updating the tree so the new node just appears in the proper location and the tree expands properly. I've tried many different techniques but none produce the desired results. Can someone advise on the correct technique to use to update the tree UI when a new node is inserted in the tree? Also, do you know a web site that contains a swing tree that I can view using my browser. I am having a problem viewing my tree on Solaris using Netscape 6.0 and I'd like to confirm if it is Netscape 6 or not since the tree works as usual using Netscape 4.7.
Many thanks.

This example should solve your problem:
     DefaultMutableTreeNode dmtn = _getActionsNode(); // returns a DefaultMutableTreeNode
     DefaultTreeModel dtm = new DefaultTreeModel(dmtn);
     getActionsTree().setModel(dtm); // this is the JTree
Hope this helps.

Similar Messages

  • Javax.swing.tree.DefaultMutableTreeNode

    I have a tree with some nodes in it.
    I am using setAllowsChildren(boolean x) method of javax.swing.tree.DefaultMutableTreeNode on the nodes.
    But the problem i m facing is
    1....if setAllowsChildren() method returns true ,i m getting tree icon displayed on side of node(irrespective of whether the node has children or not )
    I m facing with a challenge of allowing node to have children by using
    setAllowsChildren(true) and at the same time display tree icon only when children are present.
    Some of my friends say it is a java bug.
    If not how do i go about solving this one.
    Thanks in advance

    Ok i will put it in another way.
    Is there any other way by which the tree icon can be made to display
    without the usage of[b] setAllowsChildren() method

  • Java swing tree view interact with indesign javascript

    i have java swing tree view(program).if i execute my program it will all indesign script folder files in tree view. what is my problem is if i click the script
    i want to execute. is it possible to execute indesign javascrpt from java swing UI. could anyone tell me pls.

    Sorry if I did not make this clear:
    This is not an InDesign issue but a Java issue. Search, or ask in a Java forum for best practice to deal with the mentioned platform specific mechanisms:
    - inter process communication (AppleEvent or TLB/OLE )
    - command line / shell script invokation
    - a way to launch an JSX script - the equivalent mechanism to File.execute() in Extendscript.
    For example, if I ask Google for "Java TLB", the second hit takes me to:
    http://dev.eclipse.org/newslists/news.eclipse.tools/msg09883.html
    Eventually you can reuse the DLL and jar - I haven't read that far.
    Google for Java AppleEvent:
    http://developer.apple.com/samplecode/AppleEvent_Send_and_Receive/listing2.html
    Note the 1999 copyright, this is pre-OSX. Also located in a "legacy documents" area. Apple has the bad habit to deprecate/abandon most of their technology every other year, so I would not be surprised if it does not work any more and you'd have to write you own JNI, JDirect or JNIDirect glue ( I don't even know the current buzzword). Ah, further digging unveiled that they even dropped the successor which was named "CocoaJava".
    If Mac specific, maybe post your questions to this list: http://lists.apple.com/mailman/listinfo/java-dev
    Dirk

  • Building swing tree

    is it possible to build a tree with the tree coordinates
    i have a tree cordinates field and the description of the co-ordinate in my database
    tree-coord description
    1.1.2         AAA
    1.1.3         aaa
    2.1.2         VVV
    2.2.3         TTR
    I have build a tree according the co-ordinates.can any one give me a clue how to build tree with the given tree cordinates?
    is there any API for this?

    you can use swings to display data in a hierarchical manner. javax.swing.tree package would do that for you.

  • Creating file browser GUI using java swing tree

    Hi all,
    I have some questions which i wish to clarify asap. I am working on a file browser project using java swing. I need to create 2 separate buttons. 1 of them will add a 'folder' while the other button will add a 'file' to the tree when the buttons are clicked once. The sample source code known as 'DynamicTreeDemo' which is found in the java website only has 1 add button which is not what i want. Please help if you know how the program should be written. Thx a lot.
    Regards,

    Sorry, don't know 'DynamicTreeDemo'import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    import java.io.File;
    public class Test extends JFrame {
      JTree jt = new JTree();
      DefaultTreeModel dtm = (DefaultTreeModel)jt.getModel();
      JButton newDir = new JButton("new Dir"), newFile = new JButton("new File");
      public Test() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        newDir.setEnabled(false);
        newFile.setEnabled(false);
        jt.setShowsRootHandles(true);
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        File c = new File("C:\\temp");
        DefaultMutableTreeNode root = new DefaultMutableTreeNode(c);
        dtm.setRoot(root);
        addChildren(root);
        jt.addTreeSelectionListener(new TreeSelectionListener() {
          public void valueChanged(TreeSelectionEvent tse) { select(tse) ; }
        JPanel jp = new JPanel();
        content.add(jp, BorderLayout.SOUTH);
        jp.add(newDir);
        jp.add(newFile);
        newDir.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            TreePath tp = jt.getSelectionPath();
            if (tp!=null) {
              DefaultMutableTreeNode dmtn = (DefaultMutableTreeNode)tp.getLastPathComponent();
              File newFile = new File((File)dmtn.getUserObject(),"foo");
              if (newFile.mkdir()) {
                dmtn.add(new DefaultMutableTreeNode(newFile));
                dtm.nodeStructureChanged(dmtn);
              } else System.out.println("No Dir");
        newFile.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            TreePath tp = jt.getSelectionPath();
            if (tp!=null) {
              DefaultMutableTreeNode dmtn = (DefaultMutableTreeNode)tp.getLastPathComponent();
              File newFile = new File((File)dmtn.getUserObject(),"foo.txt");
              try {
                if (newFile.createNewFile()) {
                  dmtn.add(new DefaultMutableTreeNode(newFile));
                  dtm.nodeStructureChanged(dmtn);
                } else System.out.println("No File");
              catch (java.io.IOException ioe) { ioe.printStackTrace(); }
        setSize(300, 300);
        setVisible(true);
      void select(TreeSelectionEvent tse) {
        TreePath tp = jt.getSelectionPath();
        newDir.setEnabled(false);
        newFile.setEnabled(false);
        if (tp!=null) {
          DefaultMutableTreeNode dmtn = (DefaultMutableTreeNode)tp.getLastPathComponent();
          File f = (File)dmtn.getUserObject();
          if (f.isDirectory()) {
            newDir.setEnabled(true);
            newFile.setEnabled(true);
      void addChildren(DefaultMutableTreeNode parent) {
        File parentFile = (File)parent.getUserObject();
        File[] children = parentFile.listFiles();
        for (int i=0; i<children.length; i++) {
          DefaultMutableTreeNode child = new DefaultMutableTreeNode(children);
    parent.add(child);
    if (children[i].isDirectory()) addChildren(child);
    public static void main(String[] args) { new Test(); }

  • Building the swing tree  -- GR8 JAVARIANS PLEASE HELP

    I need to create a swing tree where i have set of co-ordinates in a array.
    My array contains the following value
    1.1.1.2
    1.1.3
    1.2.3
    2.6.2
    Based on this array i need to create the tree structure
    in the above co ordinates
         1.1.1.2 ->First level - First node (parent)
         1.1.3 --> should be the child node for 1.1.1.2 since this the only coordinate which is in the next level (child for      1.1.1.2)
         1.2.3- This should be the next level (2nd level)
         2.6.2- This should be the 3rd level
    My array is dynamic how to build the tree using co-ordinates?.. is there any algorithm ? API ?
    HELP NEEDED !!!!

    I'm glad you recognise that an API is what you need. You'll find one by clicking on the link on the left labelled APIs.

  • ADF Faces - af:tree - updating nodeStamp components

    My tree's nodeStamp is an af:selectBooleanCheckbox which maps to a hierarchy of items of indeterminate depth. There are usually at least 3 levels however. If I toggle a parent checkbox then all the child checkboxes must also toggle to match. That is the whole point of the parents in this tree is to be able to turn on or off sets of children, grand-children etc. This should be a pretty standard thing to do with trees. However, I have a bit of a dilemma and I'm hoping that someone out there can help me.
    When I toggle a parent checkbox the ThemeTree.valueChangeListener does a getModel().getRowData() to return the current row. I can then traverse the model tree from that instance to toggle all the children to match the state of the parent. From the model perspective everything works fine.
    However, if the tree is expanded when the parent state is changed, the visual state of the children do not change! The parent Checkbox is unchecked but the child Checkboxes remain checked :(or visa versa):
    Now to make things even more weird. If I close the parent tree and reopen it the children remain out of sync with the parent; even though the backing code model data is properly set.
    Even weirder. If the parent Checkbox is not expanded and I change the state and then I open the parent all the child Checkboxes are CORRRECTLY set.
    My jsp code looks as follows.
    <af:panelGroup partialTriggers="theme_display">
    <af:tree id="theme_tree" var="theme"
           binding="#{ThemeTree.tree}"
           value="#{ThemeTree.model}"
           partialTriggers="theme_display">
    <f:facet name="nodeStamp">
      <af:panelGroup layout="horizontal">
        <af:objectImage source="#{theme.graphic}"
                        rendered="#{theme.graphic != null}"
                        align="right"/>
        <af:objectSpacer width="3"
                         rendered="#{theme.graphic != null}"/>
        <af:selectBooleanCheckbox id="theme_tree_row"
                                  value="#{theme.display}"
                                  text="#{theme.displayName}"
                                  shortDesc="#{theme.shortDesc}"
                                  autoSubmit="true" immediate="true"
                                  valueChangeListener="#{ThemeTree.valueChangeListener}"/>
      </af:panelGroup>
    </f:facet>
    </af:tree>
    ....My ValueChangeListener looks like this.
        public void valueChangeListener(ValueChangeEvent vce) {
            if (tree != null) {
                setTreeChangeHappening(true);
                ThemeTreeBean currentTheme = (ThemeTreeBean)treeModel.getRowData();
                if (currentTheme.getChild() != null) {
                    boolean display = ((Boolean)vce.getNewValue()).booleanValue();
                    currentTheme.setDisplayAll(display);
                //TODO: is this doing what I think it is doing?  I'm starting to think not.
                AdfFacesContext afc = AdfFacesContext.getCurrentInstance();
                UIComponent checkBox = vce.getComponent();
                String id = checkBox.getId();
                int i = treeModel.getRowIndex();
                while (treeModel.isRowAvailable()) {
                    ThemeTreeBean themeBean = (ThemeTreeBean)treeModel.getRowData();
                    String x = themeBean.getName(); // used for debugging
                    String y = themeBean.getDisplayName(); // used for debuggin
                    afc.addPartialTarget(checkBox); // this might do something if we could get the instance of the UIComponent from the treeModel
                    afc.partialUpdateNotify(checkBox);
                    treeModel.setRowIndex(++i);
        }List of things that I've tried
    (a) I know how to AdfFacesContext.getCurrentInstance().addPartialTarget(vce.getComponent()) and ...partialUpdateNotify(same) but I haven't figured out how to get a handle on the UIComponent instances of the child Checkboxes. The components inside a nodeStamp facet seem to live an arms-length existance. I tried binding the selectBooleanCheckbox to a CoreSelectBooleanCheckbox property in my var class (theme) but this just doesn't work: ADF does not appear to allow it.
    (b) I tried various combinations using partialTriggers (no luck there).
    (c) The id cannot be a JSF expression (even though the JDeveloper tip claims it can; the ADF documentation says no) so I cannot get the id to find the UIComponent of the children. (Are there UIComponents of the children?)
    (d) I tried traversing the treeModel using the setRowIndex(int) method but this only stepped me through the parent level, it did no return the children. Even if it did I'm not sure how I would force the visual update of the child.
    The long and short of it is that the behaviour of components inside the nodeStamp is different and it makes for a real problem. I'm about to abandon the af:tree and see if there is anything in myfaces that might help. But before I give up altogether, I thought that I'd ask one more time to see if anyone out there could give me a hint for anything else to try.
    Thanks in advance, Mark

    More information: You cannot use the var attribute to bind the SelectBooleanCheckbox because it is not a managed bean and you can only bind to managed beans. So I created a CoreSelectBooleanCheckbox property in the ThemeTreeTree class (which is a managed bean) with the intent of matching references to the checkBox property as it rippled through the list.
    BUT...it doesn't ripple through the list. There is only one instance of the CoreSelectBooleanCheckbox which appears to be shared by all the visible components.
    So ... I'm still stumped.

  • Converting DOM object tree to Swing Tree

    I'm interested in converting a DOM object tree into a Swing TreeModel Tree.
    What prominent utilities exist for converting DOM to Swing Models in Java 1 and/or Java 2
    This seems to be a very general requirement. Please let me know if any utility code is provided for easing my task. Its Urgent !!

    The JAXM API does not supply a easy way to do this. I ended up writing a class to convert between a DOM and the SOAP Elements required by JAXM. Seems like a big oversite to me...
    chuck

  • JDeveloper 10.1.3.3.0 - ADF Swing: Conditionnaly update a row attribute

    Hi,
    I use a button to commit changes made on a swing form. It's work fine.
    I would like however to update some attributes based on the status of the current row. For instance, if I am inserting, I will update attribute A while attribute B will be updated if I am editing the current row.
    The action attached to my commit button looks like this:
    1. private void button_action(ActionEvent e){
    2. DCIteratorBinding dciter = (DCIteratorBinding) panelBinding.get("MyIterator");
    3. dciter.getCurrentRow().setAttribute("A", valueA);
    4. dciter.getCurrentRow().setAttribute("B", valueB);
    5. jUNavigationBar1.doAction(JUNavigationBar.BUTTON_COMMIT);
    I would like line 3. to be executed only if I am inserting a new row and line 4. when I am editing the current row. In other words, how to detect the status of the current row? I am not able to find any method to help.
    Thanks.

    Hi,
    I suggest to post this question to the OC4J forum
    OC4J
    Frank

  • Problem in Swing tree root node when displaying Japanese

    I'm trying to create a tree using DefaultTreeModel. The root node will display text in Japanese and the other child nodes are in English. My problem is the root node fails to show Japanese correctly (only squares are shown).
    I've already set my font.properties.ja to display Japanese font for virtual font "dialog":
    dialog.plain.0=Arial,ANSI_CHARSET
    dialog.plain.1=\uff2d\uff33 \u30b4\u30b7\u30c3\u30af,SHIFTJIS_CHARSET
    dialog.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
    dialog.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
    And I've checked the "Tree.font" of UIManager is:
    Tree.font = javax.swing.plaf.FontUIResource[family=dialog,name=Dialog,style=plain,size=12]
    I'm quite sure that my font.properties.ja is correct as all message dialogs in my app. shows Japanese correctly (also using the same dialog font).
    I got stuck. Can anyone please give me some advice? Thanks in advance.

    hello!
    first of all i am sorry that i cannot help u.
    i am a java developer and start work on
    Arabic ( one of the langugae supported by
    unicode) text editing.If u have any knowledge that
    what i should do to display the text in this language
    in a textarea.when i run a code,this display only
    square.
    plz help me.i will be realy thankful to u.
    Qaiser Mehmood
    [email protected]

  • Metadata field -Tree update don't work from Config mgr and database

    Hi All,
    I am using UCM 11g. I have a Information field of type 'Memo' which is based on a Option list which uses tree. Updating it is giving me the following problems:
    1. When i update a value in the tree using UCM CS configuration manager, sometimes the change doesn't get reflected on the update info form of a document (immediately and even after several hours)
    2. When i update directly through database end, sometimes the change is not reflected in the config mgr - information field. And sometimes it reflects there immediately but not in update form.
    Once Publishing schema and clearing browser's cookie/temp files worked, but not every time.
    Currently, i have added some data from db end, and the data is not showing up on config mgr, and even in the views there. I have tried clearing browser's cache, publish schema, publish schema base, publish schema config and data, but nothing worked.
    I don't want to go for bouncing the server option every time for such changes. Sometimes, everything does work fine instantly.
    Is there some cache etc maintained by UCM and how to clear it so that it picks up the changes in the underlying table data immediately? Please help asap as i have been stuck in this for a long time.
    P.S. I am doing it from db end in the correct manner, and doing so because i have hundreds of values to be added/updated in the metadata taxonomy tree so don't want to do it manually from ucm config mgr ui.

    '*Is there any UCM notification mechanism which we can use so as to tell it that there is some change in the underlying database or in configuration manager metadata tree; or some in built cache that we can clear so that it picks up the change*'.Nothing I would be aware of. Since you can just login directly to the database (e.g. via sqlplus) and insert/update/delete rows directly such a mechanism would have to be in the database (a trigger), but that would be an overkill.
    Updates in the database - when run from the Config Mgr, for instance - work differently - first a change is done, than a service to update the schema is called (a change, actually, means both changing the scheme and its metadata). I don't know how exactly changes in taxonomy are implemented, but I'd expect something similar - note that a lot of information is cached due to performance reasons and changes like adding/modifying a profile, option lists, or trees might require purging this cached data. Usually, at least closing the browser/re-login helps. If there is a mechanism that can force 'push-model', I'm not aware of that.

  • RMWB: Substance property tree update

    Hi,
    Can anyone suggest any method to update the characteristic in the property tree of a substance in RMWB transaction. I am writing an exit in which I have to calculate the value of a characteristic from calculation of values of other charcteristic. After getting the calculated I have to update the charcteristic in the property tree. Is this possible. If so suggest any method.
    Thanks
    Varghese

    Hello Varghese
    please follow recommendation of Mark.  The old FMs:
    C1F2_SUBSTANCES_CREATE
    C1F2_SUBSTANCES_DELETE
    C1F2_SUBSTANCES_READ
    C1F2_SUBSTANCES_READ_WITH_REF
    have been replaced by:
    C1F5_SPECIFICATIONS_READ
    C1F5_SPECIFICATIONS_MODIFY
    C1F5_SPECIFICATIONS_DELETE
    in higher SAP EH&S releases.
    Non of these FMs are (If I remember correct) released to by used by customer. The use of BAPI_BUS1077_CHANGE (or similar one) is better.
    In any case: take a look here:
    http://www.se80.co.uk/sapfms/c/c1f5/c1f5_specifications_modify.htm
    http://www.se80.co.uk/sapfms/c/c1f5/c1f5_specifications_read.htm
    http://www.se80.co.uk/sapfms/c/c1f5/c1f5_specifications_delete.htm
    Regarding the BAPI:
    http://www.se80.co.uk/sapfms/b/bapi/bapi_bus1077_change.htm
    http://www.se80.co.uk/sapfms/b/bapi/bapi_bus1077_create.htm
    http://www.se80.co.uk/sapfms/b/bapi/bapi_bus1077_delete.htm
    With best regards
    C.B.
    Edited by: Christoph Bergemann on Dec 24, 2010 1:13 PM

  • Parallel Reference - Enhance Tree Update Time

    Hi Experts!
    I have a big problem, and I don't know how to solve it.
    I have a huge tree, Nodes count about 40-50.
    I have an array of object, every object is a node in the tree. I would like to update the tree status with the objects, but it takes so much time.
    I had an idea, please take a look at the attached image.
    Splitting the obj. array with smaller pieces, Every for loop can run parallel (?), and in the Run Time Update vi contains the update procedure of the tree.
    Every Run Time Update VI operates on Tree Reference and subarray of parameters. Why this method run time is the same, when i dont split the whole array?
    Could you suggest me any solution to enhance the tree refresh time?
    Thans in advance!
    +++ In God we believe, in Trance we Trust +++
    [Hungary]
    Solved!
    Go to Solution.
    Attachments:
    Test.jpg ‏269 KB

    My Problem is solved!
    Defer Panel Update! I like it
    +++ In God we believe, in Trance we Trust +++
    [Hungary]

  • Problem in building swing tree

    I am trying to build a tree with the values obtained from the database.
    I have clearly explained the steps i have followed and the problem i am facing
    Please look at the below code, where i have given step by step explanation
    can any one help me i n solving my problem?
    //global variables
    String ioGlobalDesc = null;
    TransferObject transObj = null;
    ObjVO[] ioObjVO = null; //holds the values to build the intial tree
    ObjVO[] ioObjExpTree;//hold the child value of the every expansion
    pv.jfcx.PVNode root;
    1) I have a root node PVNode which inturn extends DefaultMutableTreeNode
    pv.jfcx.PVNode root;
    2) createIntialTree()
    This is the first method i call to obtain the values from the database .This method inturns
    call the setRootNode method to build my initial tree where i am passing the root and the ioObjVO[] which has the
    values obtained from the database
    /******************createInitial Tree starts here****************************/
    public void createIntialTree(TransferObject poTransferObject)
              Hashtable output = poTransferObject.getResponseData();
              ioObjVO = (ObjVO[]) output.get("ObjVO");
              setRootNodes(root,ioObjVO);
    3) After the setRootNode method is called from the createIntial tree,I am setting the values obtained
    from the database to the root node.Here i am using my own class called MyNode which extends the PVNode,
    This i am creating to set the desc and id for the particular node.
    If you see the setRootNode method, I have created a node called ioCategory where i am setting the id and
    description for the particular node. i have added ioCategory Node to the HashMap where desc is set as key and ioCategory itself is the value.
    Now ioCategory node is added to the root node.
    I am finiding the childcount for the obtained values from the database.while building the intial tree itself,if the child count is greater than zero,i am creating a subNode with empty values, this i am creating to denote that the particular node has the child.
    i am adding the subNode to the ioCategory.
    Now i am able to see the intial tree and also if node has childcount>0 then i am able to see the node handle.
    Now if i click any of the node which has the childcount>0,it has take the particular node id and fetch the relavant child values
    for the id i send,This is done when i expand my tree
    Now i have expanded a node Which has childcount>0 and retrieved the values from the database
    please see the treeExpand method,where the Expansion event is triggered and every expansion i am sending the
    id to the database.
    Here i have a global vairable called [ioGlobalDesc = e.getPath().getLastPathComponent().toString();]
    where i am holding the current event triggered.
    In the expandTree method , this is the method which is being called for every expansion i make ,
    Here i will be gettig the values for the node expansion.Now i am setting this value to the
    subnode where i am tryting identity the same parent to fix all the child to the same.
    for this i have stored my current expansion path and made that as node so that i can fix my childvalues to
    this.temp node should actually denote my ioCategory node for which i need to fix the child values.
    MyNode temp =(MyNode) loHashMap.get(ioGlobalDesc);
    I have another method called createnode to set my child values to the parentnode.Here i am passing the temp as the parameter
    which holds the current parent for which i have to fix the values that i have already obtained in the
    expandTree method.ioObjExpTree[] holds the childvalues for every expansion i make
    My problem is, i am unable to find the same parent for which expansion is made and unable to fix the child nodes.Is there any way to do this?
    How do i create both the parent and the child as a dynamic node?
    ie is the way i proceeded is right or wrong???????????? i am totally confused.
    can any one please help me in solving my problem??????????????
    Tell me where i have misunderstood???????????????.or my approach itself is wrong in creating the dynamic tree??
    if so how should i do it??????????????????????????????
    /****************************setRootNodes start*******************************/
    private void setRootNodes(pv.jfcx.PVNode root,ObjVO[] poObjVO) {
    int loCount=1;
    for (int i = 0; i < poObjVO.length; i++)
    if (poObjVO.getInHierarchyLevel() > 0)
    MyNode ioCategory = new MyNode(poObjVO[i].getIsHierarchyDesc(), poObjVO[i]. getIsObjID());
    loHashMap.put(poObjVO[i].getIsHierarchyDesc(),ioCategory);
    root.add(ioCategory);
    if (ioObjVO[i].inChildrenCount > 0)
    MyNode subNode = new MyNode("","");
    ioCategory.add(subNode);
    loCount++;
    /****************************treeExpanded*************************************/
    public void treeExpanded(TreeExpansionEvent e) {
    AssMO loAssMO = new AssMO();
    for (int i = 0; i < ioObjVO.length; i++)
    if (ioObjVO[i].inChildrenCount > 0 && ioObjVO[i].getIsHierarchyDesc().equals(e.getPath().getLastPathComponent().toString()))
    ioFirstHit++;
    ioGlobalDesc = e.getPath().getLastPathComponent().toString();
    e.getPath().getLastPathComponent().toString();
              loAssMO.setPID(ioObjVO[i].getPID());
         break;
    if(ioGlobalDesc!=null)
    // code goes here for sending the Id to the database which in turn calls my expandTree method which retrieves the
    /************************************expandTree Ends here**********************/
    public void expandTree(TransferObject poTransferObject) {
         Hashtable output = poTransferObject.getResponseData();
    ioObjVOExpTree = null;
         ioObjVOExpTree = (ObjVO[]) output.get("ExpandTree");
    MyNode temp =(MyNode) loHashMap.get(ioGlobalDesc);
    ioUCSLogger.debug("<--END OF EXPAND tree method-->");
    createNodes(temp);
    /************************************expandTree Ends here**********************/
    /****************************createNodes start*************************************/
    private void createNodes(MyNode poParent) {
    for(int x=0; x<ioObjVOExpTree.length; x++)
    MyNode iosubNode = new MyNode(ioObjVOExpTree[x].getIsHierarchyDesc(),ioObjVOExpTree[x].getIsObjID());
    loHashMap.put(ioObjVOExpTree[x].getIsHierarchyDesc(),iosubNode);
    poParent.add(iosubNode);
    iosubNode.setButton(1,false);

    Hi,
    I have used Tree Node type to get the nodes.
    The model that I use has the following structure:
    There is a top node called <b>Ot_Publ_Details</b>. It has 3 child nodes <b>RepObjects, Subagenobjects and Subscrobjects</b>. These child objects internally has two attributes each.
    The tree that i have created has Four Treenode types and 3 TreeItem types.
    I have bound the data source of the tree node to Ot_Publ_Details. The first TreeNode is also bound to Ot_Publ_Details. The second tree node is bound to the RepObejcts, the third node to the Subagenobjects and the fourth node to Subscrobjects. The 3 treeitem types are mapped to the corresponding child attributes.
    when i execute this application, I get a tree with the topnode taking the value from the first treenode while the other 3 nodes doesnt come as node. instead they come as leaf attributes and they display the values present in the attributes.
    Hope the model structure and the UI structure is clear.
    Regards,
    Chander

  • ADF swing tree TreeSelectionListener on view object

    hi
    i want to make an action according to the selection on a tree, and i don't know how to reach a view object and perform some event. i have made a method in the VO and put it in the client interface, but how to drag it to a specific node in the tree??
    this is the code:
    class TAction implements TreeSelectionListener
    public void actionPerformed(ActionEvent e)
    public void valueChanged(TreeSelectionEvent e) {
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)
    jTree1.getLastSelectedPathComponent();
    if (node != null){
    CreateDocumentForm gu = null;
    if(node.isLeaf()){
    String userinfo = node.getUserObject().toString();
    String parentinfo = ((DefaultMutableTreeNode)node.getParent())
    .getUserObject().toString();
    if ("All Document".equals(parentinfo)){
    if ("By Number".equals(userinfo)){
    JUControlBinding jucd = panelBinding.findControlBinding("sortByNumber");//the method in the VO is sortByNumber
    jucd.refreshControl();
    if ("By Status".equals(userinfo)){
    if ("By Project".equals(userinfo)){
    if ("By Creation Date".equals(userinfo)){
    }

    hi
    the method is not in the pageDef, how can expose it there if this solves the problem?
    the sortByNumber is working when i attach it to a button from the Data Control panel.
    what about using the setControl in the JUControlBinding, but i have problems using it.
    anyway, i want any solution to the problem as i need to attach the method in the VO programatically to the node in the tree TreeSelectionListener

Maybe you are looking for

  • Windows 7 64 Bit Import crash

    I have a core i7 system with 6 GB of RAM running Windows 7 Pro 64 bit. I installed my copy of Lightroom 2 on my C: drive and updated to 2.5. When I click the import button, the program immediately terminates. If I use the menus, the import dialog app

  • Why is the iPages 5.0 (not beta on iCloud) getting such bad reviews? I was interested in trying it.

    Why is the iPages 5.0 (not beta on iCloud) currently getting such bad reviews? I was interested in trying it on a MacBook Air or Pro.

  • What is backside illumination, got poor Image quality too

    Hi, I have recently purchased the new iPad with retina display, it had the 5mp iSight camera with backside illumination, can someone please explain what these are firstly, secondly I upgraded from the iPad 2 in hope of better photos but they still se

  • Reg completion of PI sheet

    Dear all, When  should  we complete a PI sheet in a process order. Thanks in advance

  • Opening a file within Notepad

    Hi, I am trying to open a text file within Notepad from within my java code. The aim is to provide a user with the ability to view a log file (generated by my application) simply by pressing a button on the user interface. How can I do this? I know h