Reload JTree and keep expanded nodes

Hi all,
I have spent some time looking around on this, found some useful stuff, but I still cannot seem to get a result.
Here is my situation:
I have a JTree for a GUI desktop app. I build the tree from a database file. The user has the ability to refresh the tree to keep it in sync with any database changes. The problem is that when I refresh, all the nodes that were previously expanded are now collapsed again.
Having looked around, I have seen a lot of JTree.expandRow() answers, but I don't want to use expandRow, as the rows will changes according to any db changes.
I thought a good solution would be to trap any expand or collapse events and for each either add or remove the TreePath for the relevant node onto a List. When the users refreshes the tree, I thought I could run through the list and expand any TreeNodes I find. I also found someone advocating such an approach in another thread. BUT - it doesn't work for me Here is the code for my refresh. Any help/advice, greatly appreciated.
Thanks in advance,
Steve
private void refreshBrowser(){
        System.out.println("Refresh browser - Started");       
        rootTreeNode.removeAllChildren(); // remove all nodes from root
        loadBrowserData(); // This method loads nodes from a database
         Iterator<TreePath> TPI = objectTreePaths.iterator(); // run throught my saved paths
        while (TPI.hasNext()) {
            TreePath yTreePath = TPI.next();           
            browserTree.expandPath(yTreePath); // Expand each found path
        treeModel.reload(); // model changed - reload it.
        System.out.println("Refresh browser - Complete");       
    }

Here is my situation:
I have a JTree for a GUI desktop app. I build the
tree from a database file. The user has the ability
to refresh the tree to keep it in sync with any
database changes. The problem is that when I refresh,
all the nodes that were previously expanded are now
collapsed again.
Having looked around, I have seen a lot of
JTree.expandRow() answers, but I don't want to use
expandRow, as the rows will changes according to any
db changes.you could use:
JTee.scrollPathToVisible(path);
Where path is obtained in this way from a DefaultMutableTreeNode (TreeNode):
TreePath path = new TreePath(((DefaultMutableTreeNode)node).getPath());
I thought a good solution would be to trap any expand
or collapse events and for each either add or remove
the TreePath for the relevant node onto a List. When
the users refreshes the tree, I thought I could run
through the list and expand any TreeNodes I find. I
also found someone advocating such an approach in
another thread. BUT - it doesn't work for me When you perform a JTree.reload() call, it will collapse each node.
My advice is to call JTree.reload() and then call JTree.scrollPathToVisible(path) for each TreeNode previously expanded.
Hope this can help,
regards

Similar Messages

  • Trouble with JTree's and autmoatically expanding nodes

    I am writing an application which uses a JTree as a method of browsing through a certain structure (like a file system). I am having a little trouble though, with a number of small issues, which I am finding hard to get answers through searches (and have spent a fair while searching). In navigating the tree, I want to be able to automatically expand nodes.
    Firstly, I want the Root node to automatically be expanded. I cannot see ways of doing this. I have seen references to EXPANDED being set for the JTree constructor, but I cannot see any reference in the 1.6 API for this.
    Secondly, I want to be able to expand or hide the contents of nodes through other means than clicking on the icon to the left of a non-leaf-node. For example a button that would hide the contents of (i.e. close) the currently selected node. Code such as:
    myNode.setExpanded(true);
    myNode.setExpanded(false);and
    myNode.isExpanded();

    That's the ticket - again something I had seen, but had been using in the wrong way, but your suggestion has helped me get it right. I was trying to expand the path before any more nodes were added to the root node. Then nodes are added, and the application loaded with the root node collapsed. So now I have placed the call at the end of the recursive call to populate the tree.
    Thanks again.

  • JTree and selected tree node

    I am allowing the user to search for a node in a JTree. I can find the node and progamatically expand and select the node. What I would like to do next is find the x,y coordinates of this selected node so I can use Robot to move the mouse to this node. I have hover help which is chock full of information in HTML describing this node, however, the user now is required to move the cursor to this selected node to see the hover help.
    Any help would be appreciated.

    Hi ,
    try this
    jlabel.setIcon( null ) ;

  • JTree adding to expanded nodes

    Hey,
    I'm writing a program that contains a JTree with two parent nodes and child nodes that are added/removed on demand.
    Basically I can't add child nodes while the parent node is expanded. Following the code it actually does add it, just does not update the display.
    I've tried validate/repaint/anything I could find that may be of some help with no luck.
    Any ideas?
    Thanks in advance :)

    What do you think about the library I created which
    addresses this issue?
    Denis Krukovsky
    http://dotuseful.sourceforge.net/
    I looked at your site and spent 20 minutes trying to figure out why your classes are useful. It's not at all clear why someone should use them. I also looked over your previous posts, but you never seem to explain why someone should use them.

  • Reloading JTree and expanding last selected rows

    I'm working on an applet that loads the nodes of a JTree from a database. When a node is selected, its data are displayed in a different panel. When a "reload" button is clicked, all the nodes in the JTree are removed except for the root node, and the JTree is recreated from the database. I'm try to get the new JTree to expand and select the rows that were selected before reloading, but I can't get this to work.
    Before removing the nodes, I save the currently selected row numbers using JTree.getSelectionRows(). After recreating the JTree, I re-select the previously selected rows and try to expand them:
    // tree is the name of the JTree.
    tree.setSelectionRows(selected);
    for (int i= 0; i < Array.getLength(selected); i++) {
                System.out.println("selected row: " + selected);
    tree.scrollRowToVisible(selected[i]);
    tree.updateUI();
    The previously selected rows do not automatically become visible in the resulting JTree. I also tried using tree.expandRow instead of scrollRowToVisible, with the same results.
    Any help would be appreciated!

    I think part of your problem is this...
    When you repopulate your tree, and only the root node is visible, getRowCount() will return 1. When you call expandRow(x) where x > 1, the result is basically a no-op (nothing happens). This is the correct behavior for these methods.
    In other words, I think you need to come up with a whole new algorithm.
    Let's assume you have a tree that looks like...
    Node 0
    |__________Node 0.0
    |               |__________Node 0.0.0
    |
    |__________Node 0.1
    |__________Node 0.2
                     |__________Node 0.2.0
                     |__________Node 0.2.1Try this...
    //save the current open/closed state of the tree and selection state
    Vector<Integer> selectedRows = new Vector<Integer>();
    Vector<Boolean> openClosed = new Vector<Boolean>(tree.getRowCount());
    openClosed.setSize(tree.getRowCount());
    for( int i = 0; i < tree.getRowCount(); ++i )
       if( tree.isExpanded(i) )
            openClosed.set(i,true);
       else
            openClosed.set(i,false);
       if( tree.isRowSelected(i) )
           selectedRows.add(i);
    //at this point we have all the needed state information
    // rebuild to tree from the database now
    // then do this
    int rowIndex = 0;
    while( rowIndex < tree.getRowCount() )
        if( openClosed.getElementAt(rowIndex).booleanValue() == true )
             tree.expandRow(rowIndex);
             // note that if a row gets expanded, getRowCount() will increase
        ++rowIndex;
    // at this point, your tree should be expanded exactly as it was before the reload
    int[] rows = new int[selectedRows.size()];
    int index = 0;
    for( Integer i: selectedRows )
       rows[index++] = i;
    tree.setSelectionRows(rows);
    // at this point the tree should have the same selection as before the reload.I hope this helps. Please reward me the Duke Dollars if it does. Not awarding the Duke Dollars kills the system (which is an honor system). A dead system hurts us all.
    P.S. I guess I never referenced the little tree I drew. Oh well. It looks great doesn't it?

  • How to reload prototype and keep parameters?

    Hello,
    i changed from Labview 7.11 to the newest labview 2012.
    Now i have some express-vi-teststeps in Teststand 2012.
    In the testplan it says that i have to update the prototypes because they were configured with labview 7.1.1 and are not compatible to lv2012.
    When i click on the blue arrow then the prototype is reloaded, the labview-icon is shown and the teststeps runs again.
    The problem is that after the reload all the custom values for the input-variables of the VI are lost and the default is shown (configured settings from express-vi).
    I also changed the prototype in the types.ini but this seems to be only valid for new-inserted-teststeps.
    So what i need is something like a "reload all prototypes with keeping the parameter-values".
    How can i do this?
    Thanks for help
    Solved!
    Go to Solution.

    Please use update vi tool
    Open your test sequence...
    Go to Tools - Update vi calls ( this needs LV dev on your system)
    In the process express vi call - option - select reload prototype if modified
    This should solve the issue.

  • JTree and JButton in node.

    Helo.
    I've a question regarding JTree component. I was wondering if it is possible at all.
    I want to build JTree component with JButton(JPanel) in each node, for example:
    RootNode
    |
    ---String [JButton][JButton]
    |
    ---String [JButton][JButton]
    Is there possibility to put JPanel into children node.
    Maybe anyone did do this before?
    Thanks in advance for any help.
    Regards

    This is possible. You'll have to take a look at TreeCellRenderer and TreeCellEditor, and maybe the tutorial at http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html . Basically, both interfaces allow you to return arbitrary components for rendering / editing tree nodes. The default implementation is based on JLabels, but you can use complex panels with multiple child components as well.

  • Expanding nodes in JTree

    I have an application that uses JTree
    I create the Jtree but I want to expand to see and select a node.
    I have the object of the node and the TreePath but I can't expand the tree using expandPath(), makeVisible(), scrollPathToVisible(path), etc. It seems that JTree doesn't detect the path I use as input.
    But when I use setSelectionPath(path) it is selected (I know because I see information about the node) but it is not displayed nor viewable.
    I only can expand nodes using expandRow(int).
    Does anybody know how expand and select nodes without clicking with mouse?

    expandPath(Treepath treePath) should work. Its possible that your treePath is wrong. How do you get the treePath?

  • Expanded node and children are seen only after second expansion

    Hi,
    I am using a simple JTree control. I am populating children of nodes dynamically when the node is expanded. For this, I first add a "dummy" item for each node under the root, so that the "+" sign appears next to the node. When a node is expanded, I delete the "dummy" node and add children to it. However, the first time I expand the node, the node actually doesn't expand, though treeExpanded() gets called and all children are added correctly (I verified by debugging). When I expand the tree the second time, I can see the expanded node.
    I am using TreeModel's removeNodeFromParent(childNode) and insertNodeInto(childNode, parentNode, childIndex) method to remove and add children respectively.I believe we don't have to explicitly call TreeModel's nodeChanged(), nodesWereInserted() etc?
    Could you please let me know if I am missing something fundamental here?
    Thanks in advance,
    Praneeth

    Hi db,
    I didn't realize that there was a response to my earlier thread. I added the thread to my watchlist. I was under the impression that I would be notified via email in case of a reply to the thread. However, I didn't receive any. Anyway, I did reply to that response there now.

  • Positioning expanded nodes on JTree

    Hey all,
    Does anyone know how to position an expanded node on a JTree to scroll inwards to the right (towards the current expanded level) and move to the top of the Panel it sits in? Kinda like Windows explorer.
    Any help will be greatly appreciated. Thanks in advance,
    zia

    Try to use
    setScrollsOnExpand(boolean�newValue) method of JTree
    regards
    Stas

  • Want to keep the data on one node and allow remote nodes to read it?

    by default, we have a distributed cache with backupcount=1 and data is kept over all the members in equal parts
    is there a way to do set it another way: i need only one 'main' node to put entries into the cache and keep them locally, while remote nodes can only read entries? the reason for that - i want to update the entries on the main node quite frequently (do not them travel anywhere over the network) - while remote read operations are infrequent. Also, Iwant the whole dataset survive the shutdown of any secondary node. In other words, I need 'all eggs in one backet' with remote read access.

    Andrey -
    Provided the 'remote/secondary' nodes are within the local area network, you could use a dedicated distributed cache service; storage enabled
    on the 'main' node and storage disabled on the 'secondary' nodes. Access from outside the LAN will require configuring a proxy service on the
    'main' node and 'secondary' node access over Coherence*Extend.
    /Mark

  • I keep getting download error and it does not want to download.  I tried deleting anything that might have creative suite links and reloading but I keep getting the same error message.

    I keep getting download error and it does not want to download.  I tried deleting anything that might have creative suite links and reloading but I keep getting the same error message.

    Well... what IS the error message?
    Please read https://forums.adobe.com/thread/1499014
    -try some steps such as changing browsers and turning off your firewall
    -also flush your browser cache so you are starting with a fresh browser
    http://myleniumerrors.com/installation-and-licensing-problems/creative-cloud-error-codes-w ip/
    http://helpx.adobe.com/creative-cloud/kb/failed-install-creative-cloud-desktop.html
    or
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • Just installed PS 13 elements and loaded pictures into organizer. after using PS editor now organizer is not reloading. I keep getting error message saying organizer unexpectedly quit, do you want to reopen.  When I click on it to reopen it doesn't and I

    just installed PS 13 elements and loaded pictures into organizer. after using PS editor now organizer is not reloading. I keep getting error message saying organizer unexpectedly quit, do you want to reopen.  When I click on it to reopen it doesn't and I get the same message again.  I rebooted computer, still did it,  I uninstalled and reinstalled the program and I am still getting the same error message.  This is on Mac OS with yosemite.  Any Ideas Please!!!

    Thread 8:
    0   libsystem_kernel.dylib         0x00007fff9219f4de mach_msg_trap + 10
    1   libsystem_kernel.dylib         0x00007fff9219e64f mach_msg + 55
    2   com.apple.CoreFoundation       0x00007fff97717b34 __CFRunLoopServiceMachPort + 212
    3   com.apple.CoreFoundation       0x00007fff97716ffb __CFRunLoopRun + 1371
    4   com.apple.CoreFoundation       0x00007fff97716858 CFRunLoopRunSpecific + 296
    5   com.apple.AppKit               0x00007fff8e85533b _NSEventThread + 137
    6   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    7   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    8   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 9:: cr_scratch
    0   libsystem_kernel.dylib         0x00007fff921a4136 __psynch_cvwait + 10
    1   com.adobe.CameraRaw           0x000000012122478b 0x120c28000 + 6277003
    2   com.adobe.CameraRaw           0x00000001211ad48b 0x120c28000 + 5788811
    3   com.adobe.CameraRaw           0x0000000120fad001 0x120c28000 + 3690497
    4   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    5   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    6   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 10:
    0   libsystem_kernel.dylib         0x00007fff9219f4de mach_msg_trap + 10
    1   libsystem_kernel.dylib         0x00007fff9219e64f mach_msg + 55
    2   com.apple.CoreFoundation       0x00007fff97717b34 __CFRunLoopServiceMachPort + 212
    3   com.apple.CoreFoundation       0x00007fff97716ffb __CFRunLoopRun + 1371
    4   com.apple.CoreFoundation       0x00007fff97716858 CFRunLoopRunSpecific + 296
    5   com.apple.CoreFoundation       0x00007fff977ccef1 CFRunLoopRun + 97
    6   com.adobe.ols.library         0x00000001235ebc86 OLSHTTPTransaction::Execute() + 4166
    7   com.adobe.ols.library         0x00000001236174f9 OLSServiceTask::PerformMessageExchangeServerPOST(OLSAutoRefPtr<OLSElement> const&, OLSAutoRefPtr<OLSElement> const&) + 1849
    8   com.adobe.ols.library         0x000000012360958a OLSServiceTask::PerformMessageExchangeServer(OLSAutoRefPtr<OLSElement> const&, OLSAutoRefPtr<OLSElement> const&) + 1834
    9   com.adobe.ols.library         0x000000012361626c OLSServiceTask::ProcessUnhandledMessageList(OLSAutoRefPtr<OLSElement> const&, OLSAutoRefPtr<OLSElement> const&, OLSAutoRefPtr<OLSElement> const&, OLSMessageOrigin) + 1804
    10  com.adobe.ols.library         0x00000001235c885c OLSClientSession::ProcessUnhandledMessageList(OLSAutoRefPtr<OLSElement> const&, OLSAutoRefPtr<OLSElement> const&, OLSAutoRefPtr<OLSElement> const&, OLSMessageOrigin) + 124
    11  com.adobe.ols.library         0x00000001235c6921 OLSClientSession::ProcessMessageList(OLSAutoRefPtr<OLSElement> const&, OLSAutoRefPtr<OLSElement> const&, OLSMessageOrigin) + 2593
    12  com.adobe.ols.library         0x0000000123608d3a OLSServiceTask::ExecuteStateMessageExchangeServer() + 426
    13  com.adobe.ols.library         0x00000001236010cc OLSServiceTask::ExecuteInternal() + 1196
    14  com.adobe.ols.library         0x000000012361b22e OLSTask::Execute() + 350
    15  com.adobe.ols.library         0x000000012361c874 OLSWorkerThreadTaskManager::ProcessTasks(OLSTaskThread*) + 1300
    16  com.adobe.ols.library         0x000000012361b454 OLSTaskThread::Run() + 36
    17  com.adobe.ols.library         0x000000012363fd88 OLSThread::ThreadProc(void*) + 54
    18  com.apple.CoreServices.CarbonCore 0x00007fff9c7108dc PrivateMPEntryPoint + 58
    19  libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    20  libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    21  libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 11:
    0   libsystem_kernel.dylib         0x00007fff921a475a __sigwait + 10
    1   com.adobe.ElementsOrganizer13 0x000000010dce1a84 0x10cc7e000 + 17185412
    2   com.adobe.ElementsOrganizer13 0x000000010dce5d15 0x10cc7e000 + 17202453
    3   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    4   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    5   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 12:: com.apple.NSURLConnectionLoader
    0   libsystem_kernel.dylib         0x00007fff9219f4de mach_msg_trap + 10
    1   libsystem_kernel.dylib         0x00007fff9219e64f mach_msg + 55
    2   com.apple.CoreFoundation       0x00007fff97717b34 __CFRunLoopServiceMachPort + 212
    3   com.apple.CoreFoundation       0x00007fff97716ffb __CFRunLoopRun + 1371
    4   com.apple.CoreFoundation       0x00007fff97716858 CFRunLoopRunSpecific + 296
    5   com.apple.CFNetwork           0x00007fff8fcfac80 +[NSURLConnection(Loader) _resourceLoadLoop:] + 434
    6   com.apple.Foundation           0x00007fff90df190a __NSThread__main__ + 1345
    7   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    8   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    9   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 13:: com.apple.CFSocket.private
    0   libsystem_kernel.dylib         0x00007fff921a43fa __select + 10
    1   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    2   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    3   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 14:
    0   libsystem_kernel.dylib         0x00007fff921a4136 __psynch_cvwait + 10
    1   com.adobe.ElementsOrganizer13 0x000000010dce02fd 0x10cc7e000 + 17179389
    2   com.adobe.ElementsOrganizer13 0x000000010cd34e19 0x10cc7e000 + 749081
    3   com.adobe.ElementsOrganizer13 0x000000010dce5d15 0x10cc7e000 + 17202453
    4   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    5   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    6   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 15:
    0   libsystem_kernel.dylib         0x00007fff921a4136 __psynch_cvwait + 10
    1   com.adobe.ElementsOrganizer13 0x000000010dce02fd 0x10cc7e000 + 17179389
    2   com.adobe.ElementsOrganizer13 0x000000010cd34e19 0x10cc7e000 + 749081
    3   com.adobe.ElementsOrganizer13 0x000000010dce5d15 0x10cc7e000 + 17202453
    4   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    5   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    6   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 16:: JavaScriptCore::BlockFree
    0   libsystem_kernel.dylib         0x00007fff921a4136 __psynch_cvwait + 10
    1   libc++.1.dylib                 0x00007fff8fb2ad2e std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 126
    2   com.apple.JavaScriptCore       0x00007fff99593aaa JSC::BlockAllocator::waitForDuration(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >) + 170
    3   com.apple.JavaScriptCore       0x00007fff993828f4 JSC::BlockAllocator::blockFreeingThreadMain() + 84
    4   com.apple.JavaScriptCore       0x00007fff9937814f WTF::wtfThreadEntryPoint(void*) + 15
    5   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    6   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    7   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 17:: JavaScriptCore::Marking
    0   libsystem_kernel.dylib         0x00007fff921a4136 __psynch_cvwait + 10
    1   libc++.1.dylib                 0x00007fff8fb2ac95 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 47
    2   com.apple.JavaScriptCore       0x00007fff99382f1b JSC::GCThread::waitForNextPhase() + 171
    3   com.apple.JavaScriptCore       0x00007fff99382d78 JSC::GCThread::gcThreadMain() + 88
    4   com.apple.JavaScriptCore       0x00007fff9937814f WTF::wtfThreadEntryPoint(void*) + 15
    5   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    6   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    7   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 18:: JavaScriptCore::Marking
    0   libsystem_kernel.dylib         0x00007fff921a4136 __psynch_cvwait + 10
    1   libc++.1.dylib                 0x00007fff8fb2ac95 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 47
    2   com.apple.JavaScriptCore       0x00007fff99382f1b JSC::GCThread::waitForNextPhase() + 171
    3   com.apple.JavaScriptCore       0x00007fff99382d78 JSC::GCThread::gcThreadMain() + 88
    4   com.apple.JavaScriptCore       0x00007fff9937814f WTF::wtfThreadEntryPoint(void*) + 15
    5   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    6   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    7   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 19:: JavaScriptCore::Marking
    0   libsystem_kernel.dylib         0x00007fff921a4136 __psynch_cvwait + 10
    1   libc++.1.dylib                 0x00007fff8fb2ac95 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 47
    2   com.apple.JavaScriptCore       0x00007fff99382f1b JSC::GCThread::waitForNextPhase() + 171
    3   com.apple.JavaScriptCore       0x00007fff99382d78 JSC::GCThread::gcThreadMain() + 88
    4   com.apple.JavaScriptCore       0x00007fff9937814f WTF::wtfThreadEntryPoint(void*) + 15
    5   libsystem_pthread.dylib       0x00007fff974c1268 _pthread_body + 131
    6   libsystem_pthread.dylib       0x00007fff974c11e5 _pthread_start + 176
    7   libsystem_pthread.dylib       0x00007fff974bf41d thread_start + 13
    Thread 0 crashed with X86 Thread State (64-bit):
      rax: 0x00000000000000b0  rbx: 0x00006080000b4460  rcx: 0x00007fff52f7da08  rdx: 0x00007fff52f7d8c0
      rdi: 0x00006080001d31a0  rsi: 0x0000000000000000  rbp: 0x00007fff52f7d860  rsp: 0x00007fff52f7d830
       r8: 0x00007fff52f7d9d8   r9: 0x00007fff52f7d9a0  r10: 0x0000000000000000  r11: 0x0000000110825b90
      r12: 0x00007fff52f7d9a0  r13: 0x00007fff52f7e0e8  r14: 0x00007fff52f7d8c0  r15: 0x00006080000b4460
      rip: 0x0000000110825ba6  rfl: 0x0000000000010206  cr2: 0x0000000000000000
    Logical CPU:     1
    Error Code:      0x00000004
    Trap Number:     14

  • ITunes keeps providing a message that iPod is currupted.  I have restored the iPod and reloaded iTunes but keep getting the same message that the iPod is currupted.

    iTunes keeps giving me the message that my iPod is currupted.  I have restored the iPod and reloaded iTunes but keep getting the same message.  What's weird is that my iPod will connect to another PC and that my PC will connect to my daughter's iTouch.  Any ideas?  My iPod was working with my PC for years and just started getting this error.

    According to this article: http://support.apple.com/kb/TS3694
    Restore loop (being prompted to restore again after a restore successfully completes): This issue is typically caused by out-of-date or incorrectly configured third-party security software. Please followTroubleshooting security software issues if USB troubleshooting does not resolve this issue.
    B-rock

  • Select Expanded nodes in JTree

    Hi all,
    In the given tree structure, I want to get a node to be selected, once it is expanded.
    + Folder1
    - Folder2
          |
          |__-Folder3
           |
           |__-Folder4
              |
                |__ file1.docCurrently, if I have Folder1 selected and if I expand Folder2, the selection remains at
    Folder1 itself. I need to change the selection to Folder2.
    Also, I need to get the path of the expanded node . ie; when Folder4 is expanded, I need to
    get Folder4 selected and path has to be obtained as \Folder2\Folder3\Folder4.
    I found this link helpful-- http://forums.sun.com/thread.jspa?messageID=3616726, but there
    also, the path is obtained based on selection and not based on expansion.
    Please help with a solution
    Regards,
    Anees

    AneesAhamed wrote:
    Hi all,
    In the given tree structure, I want to get a node to be selected, once it is expanded.
    + Folder1
    - Folder2
    |
    |__-Folder3
           |
           |__-Folder4
              |
                |__ file1.docCurrently, if I have Folder1 selected and if I expand Folder2, the selection remains at
    Folder1 itself. I need to change the selection to Folder2.
    Also, I need to get the path of the expanded node . ie; when Folder4 is expanded, I need to
    get Folder4 selected and path has to be obtained as \Folder2\Folder3\Folder4.
    I found this link helpful-- http://forums.sun.com/thread.jspa?messageID=3616726, but there
    also, the path is obtained based on selection and not based on expansion.
    Please help with a solution
    Regards,
    AneesTo expand any node you need to "know" it either due to a user's mouse click or inside the code that expands it directly, something like :
    - by mouse click :
    myJTree.addMouseListener(new MouseAdapter()
         public void mouseClicked(MouseEvent e)
              TreePath treePath = getPathForLocation(e.getX(), e.getY());
    });- direct code :
    public void treeWillExpand(TreeExpansionEvent e)
         TreePath treePath = e.getPath();
    }Then you can get the corresponding node from the TreePath :
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent();But for a selection this should be enough :
    myJTree.setSelectionPath(treePath);
    myJTree.scrollPathToVisible(treePath);Regards,
    Lara.

Maybe you are looking for