How can I update multiple JTrees GUI Simutaneously??


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How can I update multiple JTrees GUI Simutaneously??

  1. #1
    Join Date
    May 2006
    Posts
    1

    How can I update multiple JTrees GUI Simutaneously??

    Hi guys, thank you for viewing my thread.

    I have 2 JTree objects.(Tree1&Tree2). I wrote a JTree node selection listener which extends the MouseAdaptor to respond to mouse click in my first JTree object(Tree1).

    The listener works fine and can return me what I need, for example return me the node I clicked and some associated information which should be used to update my second tree(Tree2) correspondingly. These 2 trees locate in two separated splitPane in one GUI window.

    My idea is let the second tree(Tree2) be updated simutaneously upon the clicking in my first JTree node(Tree1).

    My question is: How could I inform the second tree(Tree2) about my mouse event in the first tree? I mean how could I let Tree2's GUI update automatically upon any event in Tree1? Should I use multithread for it, such as invokeLater()? Is there any minimum solution for this?

    Is there any hints and examples?
    Thanks
    Michael

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    Use the TreeSelectionListener with Tree1.

    Code:
    Tree1.addTreeSelectionListener()
    
    public void valueChanged(TreeSelectionEvent e)
    {
        Tree2.something()
    }

Similar Threads

  1. SQL Insert data in Multiple table and Update at same time
    By software_develo in forum Database
    Replies: 10
    Last Post: 02-21-2012, 11:02 AM
  2. how do i update multiple tables?
    By Ervin Rodriguez in forum Database
    Replies: 0
    Last Post: 01-16-2002, 07:50 PM
  3. UPDATE for multiple tables
    By Kay in forum Database
    Replies: 1
    Last Post: 07-04-2001, 04:50 AM
  4. Multiple tables in Update (ANSI SQL only)
    By Farhan in forum Database
    Replies: 1
    Last Post: 03-14-2001, 02:25 PM
  5. Multiple records updating on UPDATE
    By Michael Cole in forum VB Classic
    Replies: 1
    Last Post: 05-17-2000, 10:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center