settings columnnames of jtable:

T

t12be

I'm trying to localize the columnames in a jtable. I used an
AbstractTableModel to create this table.
A quest throw the API didn't help me out. I found methods like
setTableHeader() but these used objects other than Strings to adjust
these columnNames.

Anyone who knows how to do this please email me at:
(e-mail address removed)

thx
 
M

Michael Rauscher

Hi someone,
I'm trying to localize the columnames in a jtable. I used an
AbstractTableModel to create this table.
A quest throw the API didn't help me out. I found methods like
setTableHeader() but these used objects other than Strings to adjust
these columnNames.

overwrite getColumnName(int column) in your model:

e.g
class MyTableModel extends AbstractTableModel {
private String columNames[];

// some code
// initialization of columnNames
// ...

public String getColumnName( int column ) {
return columnNames[column];
}
}

Bye
Michael
 
T

t12be

Michael Rauscher said:
Hi someone,
overwrite getColumnName(int column) in your model:
....

Bye
Michael

Yep works. Thank a lot for helping me out, strungeld a long time not
realising the solution would be that simple.

greatings
t12be
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top