How can i refresh a jtree using DefaultMutableTreeNode?

I already create a jtree using DefaultMutableTreeNode, and i also could implement to it the addMouseListener to do a action when the user press every node......Also i used the following instruction to remove all nodes: root_tree.removeAllChildren(); and it instruction remove all the nodes....but when i :
fill the tree
compile my program
i see the tree in my jpanel....it is Ok!
now.....
fill the tree
remove the tree
compile my program
i see only the root (this i wish) it is Ok!
But now i would like that after that i press a combo element (in the actionperformed method):
remove the tree
fill the three with the new nodes
show the tree
But my tree always is the same :(......is like it to need a repaint ....but i already implement it...but i obtain the same result.....
Do somebody have any suggestion...or idea how i can do a refresh in my jtree?....
Anybody could help me please?
Thanks in advance.....
Mary

Construct your tree like this:DefaultMutableTreeNode rootNode = xxx;
DefaultTreeModel model = new DefaultTreeModel( rootNode );
JTree tree = new JTree( model );When you update the root node, just tell the model to fire the appropriate change event by doing this:model.reload( rootNode );or this:model.nodeStructureChanged( rootNode );or this:model.setRoot( rootNode )

Similar Messages

  • How can I refresh a web site that I use often but it also changes its content frequently. Where is the refresh icon?

    I use to refresh my browser & web pages by clicking on the "refresh" button. This button is no longer on my browser. how can I refresh a web page or keep it up to date if there is no refresh icon to use.?

    Firefox 4 and later use a combined Stop/Reload/Go button that is positioned at the right end of the location bar.<br />
    During the page load process it shows as a Stop button and after the loading has finished the button is changed to a Reload button.<br />
    If you type in the location bar then that button becomes a Go button.<br />
    Middle-click the Reload button to duplicate the current tab to a new tab.<br />
    *https://support.mozilla.com/kb/common-questions-after-updating-firefox

  • How can I "refresh" my iTunes Library?

    How can I "refresh" my iTunes Library? I recently moved my library to an external and made the source folder change in preferences. My library now shows all exclamations asking me to locate the files. What is the quick fix to locate or "refresh" all?

    Michael,
    Your response here seems exaclty like the answer that I need.  My logic board broke and I had to get a new one.  Sent to Apple and all is working again.  I didn't have an super recent time machine back up....my last one was 2 months old.  I was able to salvage my music from the computer before sending in for repair and when I got it back, I reloaded my music file onto my machine.  I use iTunes match so maybe that kept many of my files/playlists etc in order.  But my iTunes is asking me to download many songs that are showing in iTunes and are in a folder in iTunes.  These are songs I downloaded during that 2 month break between time machine backups.  I think a refresh will fix this issue.  But when I follow your steps above, I not certain what file to choose.  I tried to go to my itunes ---> itunes media ---> music but that doesn't work.  Do I need to choose the "iTuens Library.itl" file?  I use my playlists for my job so I don't want to just guess here and lose everything.  I did do a backup of my playlists so hopefully I'm protected if something happens but just want a bit more guidance on this.  Thank you for your help and your time and let me know if you have any questions. 
    Best,
    Kirk

  • How can i refresh all CMP cache?

    Hi,
    In my application i need to delete many rows from DB using direct mySql commands. after i do that, my application server is still using the cached entity beans from before the deletion, and this might cause problems.
    How can i refresh all the entity beans cache completely?

    In my application i need to delete many rows from DB
    using direct mySql commands. after i do that, my
    application server is still using the cached entity
    beans from before the deletion, and this might cause
    problems.
    How can i refresh all the entity beans cache
    completely?Maybe if you were really using EJB you would know the answer. Describe the problems this is causing and explain what you don't respond to your forum post. Do you know how to write a SQL statement? Do you know what CMP stands for? Would you like to know how to create software programs?

  • How can i refresh the session object

    Hello..
    I am jst learning jsp... i hav a problem plz help me...
    I am using <jsp:useBean id="util" class="myUtilClass" scope="session" />
    I hav modified the object content...
    how can i refresh the object...
    ie...i want to access the modified data in the session object...

    You don't do that. It should already be reflected.
    Unless you modified another instance of it. If this is the case, then fix your code logic accordingly that it modifies the right object instance.

  • How can my wife and I use our two iTunes account on one iPad

    How can my wife and I use our two iTunes accounts on one IPad

    Unfortunately it will be difficult. iPads are personal devices like phones and done have credentials. You can of course log out of and into the app store to download purchased apps but the iPad will then have all the apps of both your wife and you (though you could put these into folders I guess).
    /H

  • I have two Apple ID, how can I delete one and use the email address associates to the main one?

    I have two Apple ID, how can I delete one and use the email address associates to the main one?

    If you abandon one of the Apple IDs you will also basically be abandoning any content that you have acquired with that Apple ID. Content can only be updated and re-downloaded with the Apple ID that was used to buy it. Apple will not combine the content of Apple IDs and Apple will not transfer the content from one Apple ID to another Apple ID.

  • I have a company Ipad that belonged to a deceased employee. no access to his icloud or appleID. how can I restore it for use with a new apple ID

    I have a company Ipad that belonged to a deceased employee. no access to his icloud or appleID. how can I restore it for use with a new apple ID?
    The apple ID was his personal account and can no longer gain access. Im sure I can get purchase recipts from the accounting department if needed. I tried to put the Ipad in restore mode and used itunes to "recover" the ipad but it still wont let me in because he registered the device with the "lost iphone" feature or whatever that is.

    Activation Lock in iOS 7  >  http://support.apple.com/kb/HT5818
    The Apple ID and Password that was Originally used to Activate the iDevice is required
    If you do not have that information you will not be able to use the Device.

  • HT1539 How can a digital copy be used in a household with multiple apple ids, synced on the same computer?

    How can a digital copy be used in a household with multiple apple ids, synced on the same computer?  I want to put a digital copy on my device, and on my wife's device.
    Please help.

    you're welcome.
    actually, unless you take an extra step, the first opened swf will close.  if you want the 2nd to close, the initial receiving lc will send a message to sender that causes the sender to close.

  • How can I turn my Mac using iTunes into an alarm clock?

    Here's my question: How can I turn my Mac, using iTunes, into an alarm clock?
    I want to be able to put my Mac to sleep but have it set up so that when it wakes up at the predetermined time iTunes will open and start playing the music I've selected....
    A "musical alarm clock"...
    A friend suggested using the Energy Saver option in Sys. Preferences to wake the computer at the right time. He said that then I could use iCal to start iTunes. I would then have to use an Apple Script to get iTunes to play the song I want.
    But is there a SIMPLER way to do this? Are there any programs out there that do this already??
    Thanks for any help....

    I recently got a copy of AlarmClock Pro from MacWorld UK. It is shareware, I think it is (USD?)19. I haven't had a chance to try it out much, but it does look quite good. I have an older version. The latest version looks even better.
    I'm sure there's plenty of freeware apps out there. You might also want to try looking here for an applescript here Doug's AppleScripts for iTunes
    p53

  • How can I update my app using my own ac?

    can I know if I can update my app from the other ac ?cause when I downloaded the app I used my friend ID  but now I can't contact him .so how can I update the app using my own ac?

    You can't, all content is tied to the account that bought/downloaded it, so only that account will be able to download updates to its apps.

  • How can I remove a flag using a rule in Mail.app?

    I'm using Mail Act-On to flag messages that are important. I also have got a smart mailbox that displays only those messages that are flagged, this is my "To Do" mailbox.
    Once I've read and answered the message I want to remove the flag, preferrably via a rule using Mail Act-On as well. However in the rules dialog in the Mail.app preferences there's only the option to set a flag, not to remove one.
    Can anyone help: how can I remove a flag using a rule?? Maybe via Applescript as the last resort?
    Thanks for any advice Jan

    Hi Jan
    I haven't gotten around to put unread and unflag into Mail-ActOn but MailTags has the functionality. MailTags also allows you to mark a message unread via act-On rule.
    It is interesting to note that apple doesn't include unflag and unread as the rules were originally intended to apply only to new messages (of which none should be read or flagged) with that logic, there would be no need for unread, unflagg.
    @David: The reason to do it via Act-On rule would be to set up a sequence of events, one of which is to unflag, others may be to set keywords, move messages, set colors etc.
    Scott

  • How can I read a form using session in javaServerlet?(thanks)

    How can I read a form using session in javaServerlet?(thanks)

    you can not. You get the form entries through the request object.

  • How can i reformat my harddrive using the recovery disk stored in partition drive?

    hi guys! i need help. i need to reformat my harddrive and i will do this for the first time. however, i was not ablt to make the recovery disk since i purchased the tx2 1275dx laptop last july 2009. what i have is a recovery disk stored in a partition harddrive. how can i reformat my cpmputer using the recovery disk in partition harddrive? my OS is windows vista.  thank you...  

    Hi,
    Shutdown the notebook.  Tap away at f11 as you start to access Recovery Manager which you can then use to reinstall the Operating System.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Itunes and proxy settings. Itunes keeps the proxy setting from IE and I can't adapt it due to company policy. How can I force itunes to use firefox?

    itunes can not connect to server and I can't find its proxy settings.
    So I think it uses these from IE and those are blocked by company policy.
    So, how can I force itunes to use the firefox settings

    I fixed this issue (with help from tech support) and it involved several things.
    After adding a song to iTunes, right-click on the song in iTunes and select "Update iTunes Match."
    OR go to the iTunes menu-->Store-->Update iTunes Match.
    Maybe that's the reason, it just hadn't updated to the cloud.
    OR maybe it's not a high-enough bitrate file.   This happens to me because most of my tunes are home-recorded.
    Sometimes converting to .mp3 or Create AAC version might work. (You do this with a right-click in iTunes, and then you will want to remove the original file from iTunes.)
    There is an iTunes Preferences setting, under General Preferences called Import Settings.  Try setting it to AAC Encoder and iTunes Plus.   That (I think) causes imports to be slightly better quality.
    Good luck!  The tech support person at Apple is requesting that a knowlege-base article be written about this.

Maybe you are looking for