File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree Display problem" Watch "JTree Display problem" New topic

JTree Display problem

Bonagiri UmaMaheshwar Rao

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();
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:
subject: JTree Display problem
jQuery in Action, 3rd edition