Re: moving (JTable) columns
- From: ":-o" <fcrutch@xxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 20:13:53 -0500
"Roedy Green" <my_email_is_posted_on_my_website@xxxxxxxxxxxxxx> wrote in message
news:joqjo1tto6gg6teeq857vajgn9l8dm1p8q@xxxxxxxxxx
> On Sun, 27 Nov 2005 07:46:46 -0500, ":-o" <fcrutch@xxxxxxxxxxxx>
> wrote, quoted or indirectly quoted someone who said :
>
>>I think I know whats happening. I have a constants file with final public
>>static definitions and within this
>>file, I have an final public static array which controls the columns that the
>>s/w is locked into, which I'll need to redesign.
>>
>>final public static String[] columns {"SSN", "LastName", "FirstName",
>>etc......}
>>
>>such that when I do a findColumn (after column movement), this is where it
>>hiccups.
>
> 1. JTable has a get TableColumnModel() method.
>
> 2. You can then use getTableColumn( i ) to get the TableColumn object
> for the ith column.
>
> 3. your TableColumn object has a method getModelIndex() that tells
> where the data for that column comes from in the model.
>
> When any column moves, the mapping for step (2) changes, and listeners
> can get a columnMoved event.
>
> I don't think you should be doing any findColumn.
>
> For an experment set up a TableColumnModelListener that fires a
> fireTableDataChanged.
>
> That is not the proper solution, but if that solution fails, you know
> the problem is not in failing to refresh.
>
> Are you caching any of the TableColumns? you have to refresh that
> after a colmunMoved.
No I'm not. I'll have to do more research.
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Java custom programming, consulting and coaching.
.
- References:
- moving (JTable) columns
- From: :-o
- Re: moving (JTable) columns
- From: Roedy Green
- Re: moving (JTable) columns
- From: :-o
- Re: moving (JTable) columns
- From: Roedy Green
- moving (JTable) columns
- Prev by Date: Re: Dynamically load laf
- Next by Date: Re: Dynamically load laf
- Previous by thread: Re: moving (JTable) columns
- Next by thread: Re: moving (JTable) columns
- Index(es):