@Override public Component prepareEditor(TableCellEditor editor, int row, int column) { final Component comp = super.prepareEditor(editor, row, column); if (column == this.convertColumnIndexToView(this.treeRenderCol) && comp != null) { final int r = this.convertRowIndexToModel(row), col = column; final Rectangle rect = this.getCellRect(r, column, false); JPanel panel = new JPanel() { private static final long serialVersionUID = -4503378912490172443L; @Override protected void paintComponent(Graphics g) { super.paintComponent(g); CTreeTable.this.tree.highlightBorder = null; CTreeTable.this.tree.rowToPaint = r; CTreeTable.this.tree.colToPaint = col; CTreeTable.this.tree.setBounds(rect.x, 0, rect.width, 0); Graphics g2 = null; try { g2 = g.create(); CTreeTable.this.tree.paint(g2); } finally { if (g2 != null) { g2.dispose(); } } } @SuppressWarnings("boxing") protected boolean processCompKeyBinding(final JComponent jcomp, final KeyStroke ks, final KeyEvent e, final int condition, final boolean pressed) { boolean retr = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { boolean b = false; try { Method m = JComponent.class.getDeclaredMethod("processKeyBinding", KeyStroke.class, KeyEvent.class, int.class, boolean.class); m.setAccessible(true); b = (Boolean) m.invoke(jcomp, ks, e, condition, pressed); } catch (Exception e1) { // e1.printStackTrace(); XBRLLogger.info(e1.getMessage() + " " + e1.getStackTrace().toString(), true); } return b; } }); return retr; } @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { if (comp instanceof JComponent) { boolean b = this.processCompKeyBinding((JComponent) comp, ks, e, JComponent.WHEN_FOCUSED, pressed); if (CTreeTable.this.getSurrendersFocusOnKeystroke()) { comp.requestFocus(); } return b; } return super.processKeyBinding(ks, e, condition, pressed); } }; panel.setLayout(null); panel.setBounds(rect); int x = this.tree.getRowBounds(r).x; TreeCellRenderer tcr = this.tree.getCellRenderer(); if (tcr != null && tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer) tcr; x += dtcr.getIconTextGap() + dtcr.getIcon().getIconWidth(); } comp.setBounds(x, 0, rect.width - x, rect.height); panel.add(comp); return panel; } return comp; }