aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTree Display problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree Display problem" Watch "JTree Display problem" New topic
Author

JTree Display problem

Bonagiri UmaMaheshwar Rao
Greenhorn

Joined: Mar 27, 2005
Posts: 12
I am using JTree to display my project structure. But Tree nodes are not displayed fully. It is displyaying partially. I need to explicitly double click on each node to display its name fully. This is happening to its child nodes also. The code i have is as follows.

The sample code in init method is as follows.

public void init()
{
JTree gclsTree = getTree();
gclsTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
JScrollpane gclsTreeView = new JScrollPane(gclsTree);
getContentPane().add(gclsTreeView, BorderLayout.CENTER);
}


I am adding my tree to the ScrollPane and adding it to the ContentPane of the applet. How to display full name of the TreeNode.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTree Display problem
 
Similar Threads
JTree and JScrollPane
JTree
XML to DOM to JTree
jTree with the TreeModel
Searching a JTree