Re: Need help with a viewToModel() problem in a JTable
- From: usenet@xxxxxxx (Christian Kaufhold)
- Date: Thu, 30 Jun 2005 14:55:59 +0000 (UTC)
Gerald Rosenberg <No@xxxxxxxxxxx> wrote:
> In article <1T2b0ms0IurhNmc0@xxxxxxxxxxx>, usenet@xxxxxxx says...
>> 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.
>
> Thanks, but could you explain your suggestion.
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editrender
Christian
.
- References:
- Need help with a viewToModel() problem in a JTable
- From: Gerald Rosenberg
- Re: Need help with a viewToModel() problem in a JTable
- From: Christian Kaufhold
- Re: 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: Truncated Label Problem
- Next by Date: Re: GridBagLayout - How grow my columns correctly?
- Previous by thread: Re: Need help with a viewToModel() problem in a JTable
- Next by thread: Place JComponent in center of JDialog
- Index(es):