IntelliJ Java IDE
The moose likes Swing / AWT / SWT / JFace and the fly likes Problem using DefaultTreeCellRenderer Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "Problem using DefaultTreeCellRenderer" Watch "Problem using DefaultTreeCellRenderer" New topic
Author

Problem using DefaultTreeCellRenderer

claude jones
Greenhorn

Joined: Dec 14, 2001
Posts: 24
Hello,
I am trying to set a JTree to have a window's look and feel. Using the following:

However, when I add the following code to remove the leafIcon, the look and feel changes to the Java Look and Feel.

If I remove the code above the application uses the window's look and feel. Any ideas of what I need to do to maintain a consistent window's look and feel.

Below is the complete code:


[This message has been edited by claude jones (edited December 19, 2001).]
claude jones
Greenhorn

Joined: Dec 14, 2001
Posts: 24
I get the same problem with the look and feel changing from window's to Java when I create my own custom renderer:

Any ideas?
claude jones
Greenhorn

Joined: Dec 14, 2001
Posts: 24
I fixed my problem. I have to set the look and feel before I start adding components to my JFrame.
Thanks.
cj
 
 
subject: Problem using DefaultTreeCellRenderer
 
Threads others viewed
Help with Jtree
disabling the view of files in Jtree
JTree Sizing Question
JTree double click
JTree and Icon
MyEclipse, The Clear Choice