So the question is, is there a simpler way to attach listeners to cellrenderer components?

No. Since the renderers aren't really "there" (they are not part of the component hierarchy), they don't receive mouse events. You can do this by listening for mouse events on the TableView itself and translating to the renderer space. When the table view is in a scroll pane, you can use the getScrollTop() and getScrollLeft() methods of ScrollPane to determine the offset into the table view's coordinate space.

Alternatively, if you are finding that you need to embed components in your table view, maybe you should consider using a TablePane instead. If the data is static (or nearly so) and you don't have a large number of rows, TablePane may be a better alternative.


Reply via email to