Re: Need help with a viewToModel() problem in a JTable
- From: usenet@xxxxxxx (Christian Kaufhold)
- Date: Wed, 29 Jun 2005 11:50:34 +0000 (UTC)
Gerald Rosenberg <No@xxxxxxxxxxx> wrote:
> I have a JTable with a column that is rendered using a JTextPane-based
> cell-renderer.
>
> On a single click on that column in the JTable, I would like to
> determine the text offset of the click in the row under the user click.
>
> I thought the code below would work, but the viewToModel() method fails
> since the renderer is not actually visible -- internal to the
> viewToModel() method, the rectangle that contains the rootView is null,
> which causes the method to return -1.
>
> Can't see a workable way of forcing a visible renderer on a mouse click.
> Am I missing something or is there an alternate/better way of doing
> this?
Use a TableCellEditor.
Christian
.
- Follow-Ups:
- Re: Need help with a viewToModel() problem in a JTable
- From: Gerald Rosenberg
- Re: Need help with a viewToModel() problem in a JTable
- References:
- Need help with a viewToModel() problem in a JTable
- From: Gerald Rosenberg
- Need help with a viewToModel() problem in a JTable
- Prev by Date: Re: JTree, mouse event and complex cells
- Next by Date: Re: FileDialog.setFilenameFilter()
- Previous by thread: Need help with a viewToModel() problem in a JTable
- Next by thread: Re: Need help with a viewToModel() problem in a JTable
- Index(es):