InsertNodeInto() of DefaultTreeModel is not inserting the nodes properly.

I have some tokens, And I want to create a tree with them. insertNodeInto() of treeModel is not working as expected. I appreciate if anybody can tell me where did I do wrong.
May be the following code is useful
          for(int i=1;i< noOfTokens - 1; i++){
               nextToken = st.nextToken();
               tempNode = new DefaultMutableTreeNode(nextToken);
               if (!isChild(node, tempNode)){
                    ((DefaultTreeModel)tree.getModel()).insertNodeInto(tempNode, node, 0);
                    node = tempNode;
               } else {
                    node = (DefaultMutableTreeNode)treeModel.getChild((DefaultMutableTreeNode)node,
                                                            treeModel.getIndexOfChild(node, tempNode));
          }Regards,
Srinivas

Can somebody please help me in this.
Regards,
Srinivas

Similar Messages

  • How to do not insert the message content in the Message Inbox when use MFMessageComposeViewController control

    Dear all.
    In my app use the MFMessageComposeViewController control to send SMS message.The message content will be inserted to Message Inbox of iPhone.
    How to do not insert the message content in the Message Inbox when use this control?Because my message content has been encrypted. I don't want user can see them.
    Thanks

    I can't remember the steps, but if i'm not wrong, there are many "next" to click, and at the last windows, there is one dialog box with "do not show this message again".Maybe something to do with the registry, to enable to view this dialog box again. Date: Thu, 2 Feb 2012 06:38:24 -0700
    From: [email protected]
    To: [email protected]
    Subject: How to enable  the option "do not show this message again" in dreamweaver cs5
        Re: How to enable  the option "do not show this message again" in dreamweaver cs5
        created by Murray ACP in Dreamweaver - View the full discussion
    So, you open Site manager, click New, and then what?  I'm trying to understand which dialog you dismissed.  Can you help me?
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4180872#4180872
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4180872#4180872. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Dreamweaver by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Could someone help me out how to insert a Node properly into a DOM?

    I am trying to insert a Node built from a String to a DOM.
    Here is how I created the Node
                   Detail = "<Detail><Msg>Detail Message</Msg></Detail>";
                   prolog = "<?xml version="1.0" encoding="UTF-8"?>";
                   Node DetailNode = null;
                   Document DetailDoc = null;
                   if( Detail != null ){
                        Detail = prolog + BiometricDetail;
                        DetailDoc = xp.XML2DOM( BiometricDetail ); // transform a XML String into a DOM.
                        DetailNode = BiometricDetailDoc.getDocumentElement();                    
    Here is how I created the DOM
                   javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance();
                   javax.xml.parsers.DocumentBuilder builder = factory.newDocumentBuilder();
                   Document document = builder.newDocument();
                   Element beeE = document.createElement("BeeSets");
                   Element grpE = document.createElement("Group");          
                   bioE.appendChild( grpE );
                   // the document looks like "<BeeSets><Group></Group><BeeSets>";
                   // After inserting the Node DetailNode, I want it to look like
                   // "<BeeSets><Group><Detail><Msg>Detail Message</Msg></Detail></Group><BeeSets>";
    Now when I tried to insert the node DetailNode to the DOM document, I tried
    1) document.importNode( DetailNode, true );               
    No exception was thrown. But when I transformed the DOM document back to a String, I could not see the information from the newly imported Node DetailNode.
    When I tried
              grpE.insertBefore( BiometricDetailNode, dataE );
    I got the following exception.
         org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
         at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source)
         at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source)
         at com.jadcs.bioidentity.role.base.RP.getNodes(RP.java:497)
    2) document.adoptNode( DetailNode );
    I got the following exception.
         java.lang.ClassCastException: org.apache.xerces.dom.DocumentImpl
         at org.apache.xerces.dom.DeferredTextImpl.synchronizeData(Unknown Source)
         at org.apache.xerces.dom.NodeImpl.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.ParentNode.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.ElementImpl.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.ParentNode.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.ElementImpl.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.CoreDocumentImpl.adoptNode(Unknown Source)
         at com.jadcs.bioidentity.role.base.RP.getNodes(RP.java:509)
    3) detailStr = "<Detail><Msg>Detail Message</Msg></Detail>";
    Element detailE = document.createElement("Detail");
    detailE.setTextContent( detailStr );
    grpE.appendChild( detailE );
    This way gives result like "<BeeSets><Group><Detail><Detail><Flash>On</Flash></Detail></Detail></Group><BeeSets>";
    The content is messed up.
    Could someone help me out at how to insert a Node properly into a DOM? Thank you very much.

    Said another way, importNode actually only makes and returns a copy of the node you gave it (it will be a deep copy only if you pased true as the second parameter), but where the new dom you called import on is owner.
    So what you need to do is more like this:
    Node tempNode = domYouAreAddingTheNodeTo.importNode(node2copy,true); //true if you want a deep copy
    domYouAreAddingTheNodeTo.appendNode(tempNode);You can also traverse to any point in the DOM and insert the node there with the same method, but you always have to import first so that the DOM has a copy of the node that it owns.

  • Time achine. Each time I wake up my Mac. it says that I did not eject the disk properly. Do I have to eject the external hard drive before putting the Mac. to sleep?

    Time Machine. Each time I wake up my Mac. it says that I did not eject the disk properly. Do I have to eject the external hard drive each time I put the Mac. to sleep?

    If you do eject or disconnect that external drive before sleep, do you ever get that message?
    Some Drives & chipsets will not work right with sleep, what brand/model is it?

  • Can not create the node in Repository

    Hi,<br>
    I am trying to create a content node in BEA repository. But BEA is throwing following error:
    <i><b>Error creating Node: NODE NAME. Please verify the Node name size is within the Repository limits</b>.</i>
    <br>
    I have no idea why I am getting this error. I am creating node whose name is well under the size which is allowed by CM_NODE's node_name column. Have any one come across these kind of errors? Is there any place in portal administration where I can check for minimum/ maximum limits?
    <br>
    I really appreciate your help.
    <br>
    Thanks<br>
    Sanjay

    Hi All,
    After wasting significant amount of time, I finally found the real cause of the problem. In our application, we have some indexes on CM_NODE table. Those indexes were in unusable state. So instead of giving that error, weblogic server was giving some other error as mentioned in the previous post which resulted in lot of wastage of time. But after looking at jdbc.log file, things got cleared up. So once we fix the indexes, every thing worked fine. Too bad that portal administartion tool could not throw that exact error in debugging console.
    <BR>
    Thanks
    <BR>
    Sanjay

  • RFC is not inserting the data

    Hi all,
                    I did File to RFC scenario. My problem is when i send message the message is showen as processed successfully in SXMB_MONI. But RFC is not inserting my data in a specified table. I couldn't found where i am wrong.
    my sender strucure is:
    <MANDT>
    <WORKDATE>
    <EMPLOYEENUMBER>
    <CATSHOURS>
    R3 table name is ZTESTCATSDB
    My RFC source code is :
    FUNCTION Z_POST_TEST.
    ""Local Interface:
    *"  TABLES
    *"      CATSRECORDS_IN STRUCTURE  ZTESTCATSDB OPTIONAL
    *"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
      data wa_cats like ZTESTCATSDB.
      data wa_catdb like ZTESTCATSDB.
      data ztab  like ZTESTCATSDB OCCURS 0 WITH HEADER LINE.
      loop at catsrecords_in into wa_cats.
        ztab-WORKDATE = wa_cats-workdate.
        ztab-empnum = wa_cats-empnum.
        ztab-catshours = wa_cats-catshours.
        append ztab.
      endloop.
      insert ZTESTCATSDB from table ztab.
      commit work.
    ENDFUNCTION.
                          Plese tell me any one where i am wrong it is very urgent for me.
    Thanks,
    Satish.

    You should always check the system return code (sy-subrc) after any insert and update statement like this:
    insert ...
    if sy-subrc > 0.
      message E...
    else.
      commit work.
    endif.
    Hope that helps,
    Stefan

  • It did not insert the materials in the BOM using 'CSAP_MAT_BOM_MAINTAIN'

    Hi!
      We developed a ABAP technical maintenance BOM.
      In the program.
      Before, we got current BOM and eliminated all related items.
      Routine below.
         LOOP AT INTO it_stpo wa_stpo.
           MOVE-CORRESPONDING TO wa_stpo wa_stpo_i.
           wa_stpo_i-id_itm_ctg = wa_stpo-item_categ.
           wa_stpo_i-id_item_no = wa_stpo-item_no.
           wa_stpo_i-id_comp = wa_stpo-component.
           wa_stpo_i-fldelete = 'X'.
           APPEND TO wa_stpo_i it_stpo_i.
         ENDLOOP.
         CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN'
           EXPORTING
             Stuff = pv_matnr
             plant = p_werks
             bom_usage = p_tplis
             Alternative = p_altlis
             VALID_FROM = v_valid_from
             i_stko = pv_wa_stko
            TABLES
              t_stpo = it_stpo_i.
    After , we inserted new materials in the BOM using the same function .
    routine below
       LOOP AT INTO it_tab_i wa_tab_i ins_up_del WHERE = '1 ' OR
                                               ins_up_del = '2 ' .
            wa_stpo_i - item_categ = ' L' .
            wa_stpo_i -component = wa_tab_i - matnr_pri .
            v_menge_i = wa_tab_i - menge ( 9 ) .
            v_menge = v_menge_i / 1000 .
            WRITE TO v_menge wa_stpo_i - comp_qty .
            wa_stpo_i - comp_unit = " KG " .
            wa_stpo_i - issue_loc = " COS " .
            APPEND TO wa_stpo_i it_stpo_i .
          ENDLOOP .
    * Including new materials in the BOM .
          CALL FUNCTION ' CSAP_MAT_BOM_MAINTAIN '
            EXPORTING
              Stuff = pv_matnr
              plant = p_werks
              bom_usage = p_tplis
              Alternative = p_altlis
              VALID_FROM = v_valid_from
              i_stko = pv_wa_stko
            IMPORTING
              fl_warning = v_fl_warning
            TABLES
              t_stpo = it_stpo_i
            EXCEPTIONS
              error = 1
              OTHERS = 2 .
    But the new materials were not inserted.
    Could you help me what is missing in the routine ?
    Thanks.

    Hi!
    We found the problem.
    The problem was in the fields ID_ITM_CTG, ID_ITEM_NO and ID_COMP.
      They were not cleaned when we were inserting  the new materials in the BOM.

  • I'm trying to work with some links in Illustrator, but the program is not updating the artwork properly. What am I doing wrong?

    It's not working the update-link system in my Adobe Illustrator CC installation.

    Moving to Illustrator forum.
    Regards,
    Romit Sinha

  • BP_CONFIRM does not triggers the event properly from call list

    Hi expert,
    We have upgrading CRM 5 to 7.
    The issue is. In the IC_AGENT role. When i got to call list and select a call. The corresponding bp is automatically conformed.
    But then when i go to Account identification navigation link i can only see the bp confirmed. the vehicle  info of the BP are not displayed the view remains the same. normally it displays the vehicle details in the result view.
    If i directly search for a BP and conform it all the vehicle detail are displayed in the result views.
    It happens only when a BP is automatically conformed by selecting from the call list.
    But in both the cases the Method  "CL_CRMCMP_B_CUCOBUPA_IMPL->BP_CONFIRM" is triggered ( it is a customer control in CRMCMP_BPIDENT/CuCoBuPa )
    the difference i can find is.
    if i conform a bp manually from the account identification screen. the CL_ICCMP_AU_VEHISEARCH_IMPL->IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT is triggered. ( which is inside the "ICCMP_AUTO_VEHI/VEHISearch" ) which displays the required view.
    but when the same BP_CONFIRM is triggered automatically from the call list management view it is not triggering CL_ICCMP_AU_VEHISEARCH_IMPL->IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT. ( which is inside the "ICCMP_AUTO_VEHI/VEHISearch" ).
    so i can see the difference in the event listeners of the 2 process.
    below is the piece of code which triggers the event. it is in the method "CL_CRMCMP_B_CUCOBUPA_IMPL->BP_CONFIRM" d ( it is a customer control in CRMCMP_BPIDENT/CuCoBuPa )
    raise event BPConfirmed and/or CPConfirmed
        IF lv_bp_confirm EQ abap_true.
          CLASS cl_crm_ic_services DEFINITION LOAD.
          CREATE OBJECT event.
          event->set_name( if_crm_ic_events_con=>gc_bpconfirmed ).
          event_srv = cl_crm_ic_services=>get_event_srv_instance( ).
          event_srv->raise( event ).
        ENDIF.
    Can any one help me how to register  the event or trigger the CL_ICCMP_AU_VEHISEARCH_IMPL->IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT is triggered. ( which is inside the "ICCMP_AUTO_VEHI/VEHISearch" )
    when i click on call list.
    thanks in advance
    chella.

    Hi expert,
    We have upgrading CRM 5 to 7.
    The issue is. In the IC_AGENT role. When i got to call list and select a call. The corresponding bp is automatically conformed.
    But then when i go to Account identification navigation link i can only see the bp confirmed. the vehicle  info of the BP are not displayed the view remains the same. normally it displays the vehicle details in the result view.
    If i directly search for a BP and conform it all the vehicle detail are displayed in the result views.
    It happens only when a BP is automatically conformed by selecting from the call list.
    But in both the cases the Method  "CL_CRMCMP_B_CUCOBUPA_IMPL->BP_CONFIRM" is triggered ( it is a customer control in CRMCMP_BPIDENT/CuCoBuPa )
    the difference i can find is.
    if i conform a bp manually from the account identification screen. the CL_ICCMP_AU_VEHISEARCH_IMPL->IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT is triggered. ( which is inside the "ICCMP_AUTO_VEHI/VEHISearch" ) which displays the required view.
    but when the same BP_CONFIRM is triggered automatically from the call list management view it is not triggering CL_ICCMP_AU_VEHISEARCH_IMPL->IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT. ( which is inside the "ICCMP_AUTO_VEHI/VEHISearch" ).
    so i can see the difference in the event listeners of the 2 process.
    below is the piece of code which triggers the event. it is in the method "CL_CRMCMP_B_CUCOBUPA_IMPL->BP_CONFIRM" d ( it is a customer control in CRMCMP_BPIDENT/CuCoBuPa )
    raise event BPConfirmed and/or CPConfirmed
        IF lv_bp_confirm EQ abap_true.
          CLASS cl_crm_ic_services DEFINITION LOAD.
          CREATE OBJECT event.
          event->set_name( if_crm_ic_events_con=>gc_bpconfirmed ).
          event_srv = cl_crm_ic_services=>get_event_srv_instance( ).
          event_srv->raise( event ).
        ENDIF.
    Can any one help me how to register  the event or trigger the CL_ICCMP_AU_VEHISEARCH_IMPL->IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT is triggered. ( which is inside the "ICCMP_AUTO_VEHI/VEHISearch" )
    when i click on call list.
    thanks in advance
    chella.

  • Not getting the output properly

    i am entering the command, not get the total out put
    see the output what i am getting.
    SQL> select dbms_metadata.get_ddl ('TABLESPACE','SYSTEM') FROM DUAL;
    DBMS_METADATA.GET_DDL('TABLESPACE','SYSTEM')
    CREATE TABLESPACE "SYSTEM" DATAFILE
    '/u0101/oradata/GFSSS1/system01.dbf' S
    SQL>
    can u please suggest me , which perameters i have to set.

    i want ouput from my machine, not from OEM.
    see the output message,
    SQL> set pages 1200
    SQL> set lines 120
    SQL> select dbms_metadata.get_ddl ('TABLESPACE','SYSTEM') FROM DUAL;
    DBMS_METADATA.GET_DDL('TABLESPACE','SYSTEM')
    CREATE TABLESPACE "SYSTEM" DATAFILE
    '/u0101/oradata/GFSSS1/system01.dbf' S
    SQL>

  • I can not insert the Adobe Edge endprodukt in Adobe Dreamweaver. Why does my Dreamveaver not show In

    Why is there no way to use this Insert >> media >> adobe edge.?
    I have got Adobe Dreamweaver Cs6 so there should be no problem. And I got every single update.
    Please Help me!!! PLEASEEEE!

    Hi,
    If you are trying to insert Edge Animate compositions into Dreamweaver, here's how to do it.
    http://helpx.adobe.com/dreamweaver/using/import-edge-files.html
    Thnaks,
    Preran

  • Unicode characters are not inserted in database properly

    Hi all,
    Iam developing an application that takes entries from text boxs and inserts them in database , When i try to write in language rather than english (i use arabic) the fields are inserted but as ?????? in the database fields , i checked the codepoints of the string and every thing is ok untill the call to executeUpdate() , i think that the unicode characters represented in the codepoint array are not transferred to the database , How can i fix this problem.
    Best Regards.

    In the connection string, you have to specify character encoding.
    For example,
    jdbc:mysql://localhost:3306/database?useUnicode=true&characterEncoding=utf8

  • DefaultStyledDocument -- Not writing the alignment properly

    I am trying to write DefaultStyledDocument on a file. I am not able to write the alignments. Below is the code what I am using.
    import javax.swing.text.*;
    import javax.swing.text.rtf.*;
    import java.io.*;
    class RtfSaveAlignment
         public static void main(String argv[])
              RTFEditorKit kit = new RTFEditorKit();
              DefaultStyledDocument doc = new DefaultStyledDocument();
              MutableAttributeSet attr = new SimpleAttributeSet();
              try
                   doc.insertString(0, "some text",attr);
              catch (BadLocationException bad) { bad.printStackTrace(); }
              StyleConstants.setAlignment(attr, StyleConstants.ALIGN_CENTER);
              doc.setParagraphAttributes(0, doc.getLength(), attr, false);
              try
                   FileOutputStream out = new FileOutputStream("sample.rtf");
                   kit.write(out, doc, 0, doc.getLength());
                   out.close();
              catch (IOException ioex) { ioex.printStackTrace(); }
              catch (BadLocationException bad) { bad.printStackTrace(); }
              System.out.println((StyleConstants.getAlignment(attr) == StyleConstants.ALIGN_CENTER)?"CENTER":"NOT CENTER");
              System.exit(0);
    Please consider this request as very very ... urgent.
    Thanks

    Ok I wll follow your suggestions.import javax.swing.text.*;
    import javax.swing.text.rtf.*;
    import java.io.*;
    class RtfSaveAlignment
    public static void main(String argv[])
    RTFEditorKit kit = new RTFEditorKit();
    DefaultStyledDocument doc = new DefaultStyledDocument();
    MutableAttributeSet attr = new SimpleAttributeSet();
    try
    doc.insertString(0, "some text",attr);
    catch (BadLocationException bad) { bad.printStackTrace(); }
    StyleConstants.setAlignment(attr, StyleConstants.ALIGN_CENTER);
    doc.setParagraphAttributes(0, doc.getLength(), attr, false);
    try
    FileOutputStream out = new FileOutputStream("sample.rtf");
    kit.write(out, doc, 0, doc.getLength());
    out.close();
    catch (IOException ioex) { ioex.printStackTrace(); }
    catch (BadLocationException bad) { bad.printStackTrace(); }
    System.out.println((StyleConstants.getAlignment(attr) == StyleConstants.ALIGN_CENTER)?"CENTER":"NOT CENTER");
    System.exit(0);
    }Can you please suggest something on the above question.

  • FireFox opens two new tabs on one click then can not load the page properly

    http://windowslivehelp.com/thread.aspx?postid=D57057A2-59C8-4131-B6EC-42F7F4780E4F#D57057A2-59C8-4131-B6EC-42F7F4780E4F
    I am having trouble with the this site. It loads but keeps on trying to load. in the tab it flashes connecting ....emails and passwords not retained...connecting ...and so on.
    the functionality of the page does not allow scrolling through the page it just goes back to the opening position.
    this page and my hotmail page does not function as they should.
    Please can someone help me?

    This issue can be caused by the Facebook Toolbar extension
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Why does itunes 11 not sort the songs properly unless I am in a playlist when there is no track number

    I have lots of audio files that have names in the format of a Date (eg. 2012 01 23) with no track number.  The old I tunes always sorted them perfectly.  Now they are all out of order when I look at them under anything but if they are in a playlist.

    Did you try Alt/View/View Options...   ?

Maybe you are looking for

  • Windows 8.1 Automatic repair

    Hi, My laptop was running Windows 8.1 when it seems to have suffered (SSD) disk hardware failure. In the course of troubleshooting, I asked windows to do various things include an autorepair, and a reset. Having realised it was hardware failure, I re

  • How do I redeem a gift card in the South African storefront?

    How do I redeem a gift card in the South African storefront?

  • How do i send in my macbook?!!!

    how do i send in my macbook?!!! i wanna get it repaired but how?

  • I can't turn my ipod off

    I do the reset combo a million times, and it goes blank, with the light apple in the background, then it brightens back up and turns back on. How do I get it to turn off?? 5th generation, with video   Windows XP  

  • After Effects Comp fps settings

    Hi, I have shot some 240 fps footage and When I import it ot After Effects, I have notices that the fastest the Comp can use is 99 fps which makes the footage render our at 2.5 times slower than realtime. Is there a solution to this as I would like s