Am Montag, 16. Juli 2012 12:24:20 UTC+2 schrieb Thomas Lehmann:
> You might wonder how this relates (title)...
>
> When using "addColumn" on a table instance the model will be not adjusted to it; this means that "model.getColumnCount()" is zero but table.getColumnCount() is > 0.
>
> My problem now is a simple row sorter (taken from Java Tutorial page) which
> asks the model for the number of columns...
>
> What I did - it's working so far - is:
>
> model.setColumnCount(table.getColumnCount());
>
> Is this the recommended solution? (I believe not)
>
> Please, could somebody provide help?
>
> Thanks,
> Thomas
Here is an example:
http://www.exampledepot.com/egs/javax.swing.table/AppendCol.html