Why does JTree scrolling too slow?

A

Allen

I make a JTree with own TreeNode, TreeModel, TreeCellRenderer
definitions. And in the JTree
panel, it has a stamp painter which paints a logo image using
AlphaComposite. When I scroll
the tree with vertically, I feel it too slow because the scroll bar
moving not smoothly.

Pls help me to find the reason. Thank you.
 
C

Chris Smith

Allen said:
I make a JTree with own TreeNode, TreeModel, TreeCellRenderer
definitions. And in the JTree
panel, it has a stamp painter which paints a logo image using
AlphaComposite. When I scroll
the tree with vertically, I feel it too slow because the scroll bar
moving not smoothly.

Well, painting with alpha-composites can certainly be slow. Any chance
you can do this work once and cache the results? If not, then you might
be stuck.

In any case, before going too much further, you should get some
profiling results. Do you have access to a profiler? Eclipse includes
a free one in the TPTP (Testing and Performance Tools Platform).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top