Tab « JTree « Java Swing Q&A





1. Same JTree instance across 2 tabs    coderanch.com

I made a single TreeModel, made two JTrees from it and added one to each of two tabs in a JTabbedPane. The JTrees both seem to update automatically from the TreeModel after add/remove events on the other JTree. Here's the test code I made up to explore this: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.tree.*; public class TreeTest ...

2. JTree and Tabbed Pane    java-forums.org