Dynamically change JTabbedPane

Posted on 2006-04-23
Last Modified: 2008-02-01

Hello there,

I have a Jtree which gets populated from the database.on the right side i have 3 JTabbedPane which contains JTable inside it.the table also gets populated from the DB.Now i want to know how can i dynamically change the tab pane when i click on a tree nodes.for example.

JTree                         JTabbedPane
-xxx                           xxx     yyy    zzz

when the frame is shown for the first time JTree only shows the root i.e. xxx and the tab pane shows the xxx pane.
now when i expand the xxx node the yyy tab should be again when i expand the yyy node the zzz pane should be shown.please help me to make this work,code example will be appreciated a lot.
thanks in advance

Question by:zolf
    LVL 92

    Accepted Solution

    LVL 23

    Expert Comment


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now