Hello everyone.

 My problem is:
 I need to show a tree (javax.swing.JTree) on some image as its background.
(the tree itself is on a JScrollPane)

 so I did the following:
1: make the tree non-opaque:
    tree.setOpaque(false);
2: write a class GraphicScrollPane which subclasses the JScrollPane.
Override its "paintComponent( )" method to draw an image on it.
3: put the tree on the GraphicScrollPane:
    graphicscrollpane.getViewport().setView(tree);

 But though you can see the image under the tree, the place where the nodes
are won't be transparent. That is, you can see the white rectangle of the
nodes preventing the image to show gracefully.

 I tried the following ways but none of them could work:
 ....
 (tree.getCellRenderer( ) ).setOpaque(false);
 or
 DefaultTreeCellRenderer
 cellrenderer=(DefaultTreeCellRenderer)tree.getCellRenderer();
 cellrenderer.setBackgroundNonSelectionColor(null);
 ...
 I know the DefaultTreeCellRenderer the JTree uses is subclassed from
JLabel.  So how can I achieve my goal?

 Any suggestions or hints are appreciated greatly!
 with my best regards:
 Janet

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to