Swing and TreeTable component

TreeTable combines functionality of two components - Tree and Table. And it is really comfortable to show some hierarchical information like file system structure or many others.
TreeTable have great Qt implementation, it's fast, useful and pretty. It's a pity there is no standard Swing implementation of this component. But there are lots of third-party implementations. Let’s review them:


JEdit uses TreeTable component for Open-Save dialog. It is extremely fast and pretty. But they did it for their own, with package-private constructor and double-linked to other JEdit components. To use it in other projects means to rewrite it almost from scratch, so JEdit is just a good demo of TreeTable possibilities for Swing.


SwingLabs has their implementation. It is feature-rich and customizable. But it has some rendering bugs, much slower than JEdit version, amount of code is too big to extend it yourself and it linked a lot to other SwingX packages.


As Tim Boudreau told us, NetBeans only recently got a good implementation of TreeTable. And this implementation looks great! It works almost as fast as JEdit one, has no rendering bugs, needs only few classes to build it (but not all the framework as previous two implementations) and it's easy to use and customize. But one more problem - you may use it only under either GPL2 or CDDL, and you need to download NetBeans sources and copy org.netbeans.swing.outline package to your project to use it.

All of them extends JTable. I think it's not good, JTable is the biggest class I have ever seen, about 9000 lines of code, and SwingX implementation adds another 4000 lines. It is hard to debug and hard to customize to internals. Swing is so big because backward compatibility, but what sense of JTable compatibility for totally new component? How do you think, may be it is time to write Tree, Table and TreeTable LGPL implementation by ourselves using best practices from core swing, SwingX, JEdit and NetBeans?

No comments: