boolean (int row, int column, EventObject e) { boolean editResult = super.editCellAt(row, column, e); if (e instanceof MouseEvent me && isTreeColumn(column)){ int y = me.getY(); if (getRowHeight() != myTree.getRowHeight()) { // fix y if row heights are not equal // [todo]: review setRowHeight to synchronize heights correctly! final Rectangle tableCellRect = getCellRect(row, column, true); y = Math.min(y - tableCellRect.y, myTree.getRowHeight() - 1) + row * myTree.getRowHeight(); } MouseEvent newEvent = new MouseEvent(myTree, me.getID(), me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, column, true).x, y, me.getClickCount(), me.isPopupTrigger() ); myTree.dispatchEvent(newEvent); // Some LAFs, for example, Aqua under MAC OS X // expand tree node by MOUSE_RELEASED event. Unfortunately, // it's not possible to find easy way to wedge in table's // event sequence. Therefore we send "synthetic" release event. if (newEvent.getID()==MouseEvent.MOUSE_PRESSED) { MouseEvent newME2 = new MouseEvent( myTree, MouseEvent.MOUSE_RELEASED, me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, column, true).x, y - getCellRect(0, column, true).y, me.getClickCount(), me.isPopupTrigger() ); myTree.dispatchEvent(newME2); } } return editResult; }