JTreeTable - selecting nodes with mouse & CTRL key
843804May 1 2003 — edited Oct 16 2004Hi
I have a JTreeTable using an subclass of AbstractTreeTableModel (see "Creating TreeTables in Swing" http://java.sun.com/products/jfc/tsc/articles/treetable1/index.html).
My problem is using the mouse and CTRL key to select nodes in the tree. If I click on the table portion of the tree node (ie, the standard JLabel renderered columns in the table) with the CTRL key depressed, I get the behaviour I expect (multiple selection of non-adjacent rows). If I click on tree portion (ie, the column rendered using JTree) with the CTRL key depressed, the rows are not selected. It appears that the mouse events are being consumed before they can be handled by JTable's mouse listeners. What is strange is that holding down the SHIFT key produces the expected behaviour when clicking in both the tree and table portions of the JTreeTable (multiple selection of adjacent rows).
My code does not add/remove any key or mouse listeners and relies on the JTreeTable handling all mouse and keyboard events so this looks like standard behaviour for JTreeTable.
Anyone with ideas as to where I should start looking for a solution ?