/** * Returns the Rectangle enclosing component part that the component * provided by renderer will be draw into. */ private static Rectangle getRectangleAt(CellRendererPane cont, int x, int y) { Rectangle rect = null; Container c = cont.getParent(); // I can process only this four components at present time if (c instanceof JTable) { rect = getRectangleAt((JTable)c, x, y); } else if (c instanceof JTableHeader) { rect = getRectangleAt((JTableHeader)c, x, y); } else if (c instanceof JTree) { rect = getRectangleAt((JTree)c, x, y); } else if (c instanceof JList) { rect = getRectangleAt((JList)c, x, y); } return rect; }
Component c = getComponentAt((CellRendererPane)comp, x, y); if (c != null) { rect = getRectangleAt((CellRendererPane)comp, x, y); comp = c; Component c = getComponentAt((CellRendererPane)comp, x, y); if (c != null) { rect = getRectangleAt((CellRendererPane)comp, x, y); comp = c;