Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTreeProblem  RSS feed

 
harsh garg
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import javax.swing.*;
import java.awt.*;
import java.util.*;
class treepract extends JFrame
{
public static void main(String[] args)
{
new treepract();
}
JTree tt;
treepract()
{

tt=new JTree();
Container c=getContentPane();
c.add(tt);
setVisible(true);
pack();

}
}
question:this code show the tree,even if not add the value to the tree,how?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out source code for JTree#getDefaultTreeModel()
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!