JTRee's not updating when your not using DefaultTreeNode

See topic @ http://forums.sun.com/thread.jspa?threadID=153854&start=0&tstart=0
I have very similar issue, I have a JTree (with CheckBoxes for it's leaves and branches), and I am using a custom TreeModel rather than DefaultTreeModel.
I can add nodes to my TreeModel correctly, but the tree has doesn't always display new nodes.
Any nodes added to a node/branch show correctly if, and only if I have not expanded the branch yet. Once I expand a branch new nodes never appear. They are being added to the model correctly, because I can select them(by selcting the parent) and print all selected nodes.
In the the thread listed above it looks like all I sould have to do is implement hashCode() and equals()..
But when looking @ http://java.sun.com/javase/6/docs/api/javax/swing/tree/DefaultTreeModel.html
I cann't find anything about equals() or hashCode()
Can anyone provide some insight on what they do, or if I'm barking up the wrong tree.
PS sorry for zombifying the previous thread, most MB I've been on preffered zombies to 30 threads regarding the same issue.

so here's a severely condensed version of my code.
class CheckTreeModelSupport implements TreeModelListener {
   List alistListeners = new ArrayList<TreeModelListener>;
   //Above just struck me as odd... but I believe that's how Sun said to do it.
   public void addTreeModelListener(TreeModelListener listener) {
       if ((listener != null)  && !alistListeners.contains(listener))
          alistListeners.add(listener);
   // Also defined removeTreeModelListener(TreeModelListener), fireTreeNodesChanged(TreeModelEvent),
   // fireTreeNodesInserted(TreeModelEvent), fireTreeNodesRemoved(TreeModelEvent), fireTreeStructureChanged(TreeModelEvent)
   // and the fireTreeNodesInserted(Object, Object[], int[] Object[]) as you reccomended above.
class CheckBoxNode extends TreeModelSupport implements TreeModel {
         private String strText;                                         // text for node
         private boolean bState;                                       // stores wether the CheckBox is Checked or not
         private int iBranchCount;                                     // strores number of children
         private int iIndex;                                               //  stores index among siblings
         static CheckBoxNode cbnodeLastSelected;         // for keeping track of where to insert new nodes
   .     private List<CheckBoxNode> alistChildren;          // ArrayList of childNodes
// skipping, a laundrylist of stuff that doesn't apply    
         public CheckBoxNode addChild(String strName) {
             CheckBoxNode cbnodeNew= new CheckBoxNode(strName, this, iBranchCount);
//Constructor sets node text to strName, uses this to identify it's parent, for various initializing, and iBranchCount to set the iIndex
             TreeModelEvent eventNodeAdded = null;
             if (alistChildren == null)
                alistChildren = new ArrayListCheckBoxNode();
             alistChildren.add(cbnodeNew);
             iBranch++;
             eventNodeAdded = new TreeModelEvent(this,getPathToRoot(this), new int[]{cbnodeNew.getIndex()}, new CheckBoxNode[]{cbnodeNew});
             return cbnodeNew; } Let me know if any other code is of use, and if so what you need to see
Edited by: porpoisepower on Feb 1, 2010 10:19 PM

Similar Messages

  • HT201365 I just updated to ios 7 on my iPhone 4 how do you turn the apps off when your not using them? The old way of double clicking and then pressing the app until a red minus button comes doesn't work it opens it back up!?

    I just updated to ios 7 on my iPhone 4 how do you turn the apps off when your not using them? The old way of double clicking and then pressing the app until a red minus button comes doesn't work it opens it back up!?

    Double click home button, then swipe up on app picture (not the icon itself)

  • I've just started using the App Tabs. I think this feature could be handy but why are the sites not updated when I start Firefox. Now I have to manually update the site which is somewhat of a downer. Does any of you know where I'm going wrong?

    I've just started using the App Tabs. I think this feature could be handy but why are the sites not updated when I start Firefox. Now I have to manually update the site which is somewhat of a downer. Does any of you know where I'm going wrong?

    To answer the post title FireFox save all downloads automatically in the download folder, which you can find in the Documents folder. If you want to choose where to save your downloads go to tools>options>check always ask me where to save files.
    Secondly, I am assuming you have IE 8 installed as this is the only version that supports this fix that is currently not in beta. Go to control panel>internet options>advanced tab and reset the settings at the bottom. This may or may not fix the problem but it is a good first step.

  • HT1277 Mail on my Mac computer does not update when I update my mail on my phone and iPad.  Can anyone help me with this?  Is there a setting I need to check?

    Mail on my Mac computer does not update when I update my mail on my iPhone and iPad. Can anyone help me with this?  Is there a setting that I need to check?

    All that you had to do was to sign into the old account in order to update those apps. What I mean is that you just needed to sign into that account in the store settings like I described and that should have worked. You didnt need to enter the credit card information again - you justed needed to use the old ID and password.
    Anyway, I think the good news is that if everything else is OK with the new account, just download iBooks with the new ID - it's a free app so its not like you have to pay for it again. I'm not sure what the other App is that you are talking about - but if it is the Apple Store App - that is free as well.
    Try this anyway, when you try to update iBooks, just use the old password if the old ID still pops up.
    Did you try signing into the store settings with your new ID and see what happens with the updates then?

  • I downloaded 10.5.1 now I cannot open libraries from my external hardrive.  They are not highlighted when I open using the Option key

    I downloaded 10.5.1 now I cannot open libraries from my external hardrive.  They are not highlighted when I open using the Option key

    Hello, when you try Tylerdowner's reply make sure that you '''do not install Firefox using a limited Windows XP account''', you need sp2 and above in your xp.
    thank you

  • Why the PO action history is not updating when i perform the vacation rules

    Hi,
    Can any one explain why the action history is not updating when performed the vacation rules using the below example
    Example: A >B>C>D are in the approval hierarchy here I have defined the vacation rules by login to the user C here I selected the item type as “All” and delegated to D.
    Now the buyer “A” has sent the document for approval. The user “B” can successfully reserve funds and approved the document. Now the document is automatically delegated to D. Here D can open the document from open notifications and approved the document. Now when I checked the Action history here I cannot find the performed name D who has actually approved the document.
    Note:we are using the 11.5.10.2 version.
    The Action History in the following manner
    Seq Action Performed By
    ================================
    4 Approve C
    3 Forward B
    2 Reserved B
    1 Forward A
    0 Submit A
    From the above action history why the user D name is not showing. Can any one let me know ASAP?
    Regards,
    Keivn.
    Edited by: user10960960 on May 5, 2009 3:36 AM

    When you set up the vacation rule, if you simply delegate the ownership to D, then C retains the ownership and the approval occurs with C's limits. And hence D is treated as the approver.
    If you transfer the ownership, then C is out of the picture. The notification goes to D and when he/she approves, D's limits kick in and he will be seen as approver.
    Hope this helps,
    Sandeep Gandhi

  • Content does not update when published

    My content is not updating when I publish updates to my app. Side loading shows the updates, but an updated published folio doesn't. On the third try, I got a blank light grey screen. I finally had to unpublish and republish the content, which is obviously not an ideal situation.
    Are there any known bugs or problems at the moment that could be causing this issue? The DPS Status page doesn't have any info.
    Thanks
    -Scott

    I'm not aware of a way to get out of this state cleanly. Uninstalling and reinstalling the app fixes the problem (unless your unpublish/republish again), but it's difficult to tell your customers to uninstall/reinstall. Another option is to unpublish and then publish the affected folios as different folios, but then some of your users will end up with two versions of a similar folio until they archive the older version.
    Let me ask around to make sure that I'm correct about the cause and to see if there's a cleaner workaround.

  • HT6147 Why haven't they done a patch for those of us who have not updated and prefer to use iOS 6?

    Why haven't they done a patch for those of us who have not updated and prefer to use iOS 6?

    Totally agree with Andy. Apple needs to support its users whether or not they decide to update to iOS 7.
    The reviews from i Pad 3 owners (like me) is that when they've updated to iOS 7 they've experienced latency and sluggishness. Why would I ruin a perfectly good iPad by updating to iOS 7?
    Please let me know where I can find a patch for iOS 6.
    Thanks!

  • My macbook pro will not charge when I am using it.

    My macbook pro will not charge when I am using it. My battery will say "charged" then "not charging" and it goes back and fourth. It says "Power Source: Power Adapter". But when I use my pro it will loose the power source then reconnect a second later to it. This problem is getting annoying because I have to stop using my macbook pro to charge it.

    Reset SMC.
    http://support.apple.com/kb/HT3964
    Choose the method for:
    "Resetting SMC on portables with a battery you should not remove on your own".
    If this does not help, contact Apple.
    Best.

  • "Not sure when your phone is going to be here."

    So I pre-ordered the iPhone when it was first available, and was very happy with how quickly it got here. I enjoyed it for a day until the screen froze. Called up Verizon, who said they were very sorry for the inconvenience and with so many phone going out, they expect there to be some problems. Said I should expect my new one in 2-6 days. Well on the 6th day, call up Verizon to hear this: Oh it seems that the phone rep. entered your phone into the backordered phones, so we are not sure when yours will come in. We will however, keep you updated on the status.
    So, I get a lemon for a phone, get placed on backorder status, and am not without a phone in a job that requires a cell phone. Thanks so much.

    finswy wrote:
    I still have the previous phone, but can't even answer a phone call. Besides, I'm not going to pay for the data package on a phone that can't even access the internet.
    You don't have to pay for the data package (unless your old phone is a model that requires one).  Just reactivate your old phone by dialing *228 and selecting option 1.  Then, go online to MyVerizon and remove any data package that you don't want.  It will be re-added automatically when you activate your replacement iPhone.  In the meantime, the old phone will be active on your line and able to call and text.

  • Planner group is not updated in service notification using BAPI

    Hi,
    Planner group is not updated in service notification using BAPI BAPI_ALM_ORDER_MAINTAIN.
    I have written the below code, but planner group is not updated in the service notification.
    Please advice which parameters do i need to pass to update planner group in the service notification.
              wa_methods-refnumber      = '000001'.
              wa_methods-objecttype     = 'PARTNER'.
              wa_methods-method         = 'CREATE'.
              wa_methods-objectkey      = wa_subscr1-aufnr.
              APPEND wa_methods TO i_methods.
              wa_methods-refnumber      = '000002'.
              wa_methods-objecttype     = 'HEADER'.
              wa_methods-method         = 'CREATE'.
              wa_methods-objectkey      = wa_subscr1-aufnr.
              APPEND wa_methods TO i_methods.
              wa_methods-refnumber      = '000000'.
              wa_methods-objecttype     = ' '.
              wa_methods-method         = 'SAVE'.
              APPEND wa_methods TO i_methods.
              REFRESH i_partner.
              CLEAR wa_partner.
              wa_partner-orderid        = wa_subscr1-aufnr.
              wa_partner-partn_role     = 'VW'.
              wa_partner-partn_role_old = ''.
              wa_partner-partner        = wa_subscr1-parnr.
              wa_partner-partner_old    = ''.
              APPEND wa_partner TO i_partner.
              REFRESH i_planrgrp.
              CLEAR wa_planrgrp.
              wa_planrgrp-orderid        = wa_subscr1-aufnr.
              wa_planrgrp-plangroup      = wa_subscr1-ingpr.
              APPEND wa_planrgrp TO i_planrgrp.
              REFRESH i_planrgrp_up.
              CLEAR wa_planrgrp_up.
              wa_planrgrp_up-orderid     = wa_subscr1-aufnr.
              wa_planrgrp_up-plangroup   = 'X'.
              APPEND wa_planrgrp_up TO i_planrgrp_up.
    *----Change order details with Technician name
              CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
                TABLES
                  it_methods   = i_methods
                  it_header    = i_planrgrp
                it_header_up = i_planrgrp_up
                  it_partner   = i_partner
                  return       = i_return.
    Thanks & regards,
    Krishna

    Try this way
    CALL FUNCTION 'BAPI_SERVNOT_CREATE'
    EXPORTING
    * EXTERNAL_NUMBER =
    notif_type = 'S3'
    notifheader = ls_notif_h
    * TASK_DETERMINATION = ' '
    * SENDER =
    * ORDERID =
    IMPORTING
    NOTIFHEADER_EXPORT = ls_notif_e
    TABLES
    * NOTITEM =
    * NOTIFCAUS =
    * NOTIFACTV =
    * NOTIFTASK =
    * NOTIFPARTNR =
    * LONGTEXTS =
    * KEY_RELATIONSHIPS =
    return = lt_return
    * IF lt_return IS INITIAL.                                               " <<< Comment this lie
    read table  lt_return into ls_return with key type = 'E'. " << Change
    if sy-subrc ne 0.                                                             " << Change
    COMMIT WORK AND WAIT.
    write: / ls_notif_e-NOTIF_NO.
    ELSE.
    LOOP AT lt_return INTO ls_return.
    WRITE:/ 'errors'.
    * ls_return.
    ENDLOOP.
    endif.

  • IPod will not update when plugged into computer?

    Just recently my iPod with not update when I plug it into my computer. My iPod does not show up on my Mac or my iTunes. When I plug it in the screen shows the do not disconnect sign. I have tried to reset my iPod and checked for new updates, but they haven't worked. If anyone knows what to do that would be great.
    Thanks

    Yes. Since I installed the new system software (10.4.6) update Sunday night, I cannot update any of my iPods except the iPod video. The iPods also do not show up on my desktop. The battery charges but that's all that happens.

  • ITunes play count does not update when iPod is connected

    iTunes keeps track of how many times i play the song on my computer but does not update when I connect my iPod. Is there a way to fix this??
    thanks!!

    I just checked and it does update for me. I'm still waiting to see if it updates from the AppleTV though.

  • My iPod touch 5th generation battery indicator does not update when being charged (Updated to iOS 8)

    Note that the iPod touch 5th generation was updated to iOS 8. When I connect my charger to my iPod touch, for the first time, the battery indicator does not update when connected to a power source. Instead of being charged, it says that the battery is being depleted. Please fix this issue. Thank you!

    Not Charge
    - See:    
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
    - If a 5G iPod      
    Iphone 5 lightning port charging problem - SOLUTION!
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • My mail program does not update when I delete emails in my other email programs (i.e. it still shows messages in my mail inbox when I've deleted them).  I think this started with Maverick?  Any solutions?

    My mail program does not update when I delete emails in my other email programs (i.e. it still shows messages in my mail inbox when I've deleted them).  I think this started with Maverick?  Any solutions?

    one is gmail, one is a university email and they are both IMAP accounts (not that I know what that means)....

Maybe you are looking for

  • Get error 69 trying to restore from a backup CD

    I have only seen this error associated with an ipod in every search I have made.  Can not contact Apple Itunes Support without a serial number... the problem is not with my ipod!!!!! It is when I try to restore from the CD's I burned!! If I "explore"

  • Ipad won't start after updating to ios 8.1.3

    My iPad was working without issue prior to updating to IOS 8.1.3 yesterday. After updating, not only would the ipad not start, it produced intermittent tones. The tone heard when device is plugged into an outlet for charging. I attempted to turn the

  • How do I transfer books in my kobo app on my iPad to my mini iPad?

    I have books on my IPad in the Kobo app. How do I transfer them to the Kobo app on my mini IPad?

  • A.out apps on Solaris 8

    I'm doing some development work on the kernel, and was curious to know if anybody knows of any old a.out apps that are currently being run on Solaris 8 boxes. I need to know in order to decide if it's worth the effort to support a.out, or if it's suc

  • How to export pictures to facebook

    Hello, I am having trouble with exporting my pictures via facebook.  I have the most updated version of CS5 and bridge (4.0.5.11) and can see the facebook export icon.  When I try to log into facebook to add pictures it says try again later and when