Skip to main content

ColumnHeaderRenderer

No replies
Anonymous

Hi folks,

is there a way to change the headerRenderer from ColumnHeaderRenderer to
a custom one?

In TableColumnExt.java we have this:

public TableCellRenderer getHeaderRenderer() {
if (headerRenderer == null) {
if (headerProperties != null) {
headerRenderer = new ColumnHeaderRenderer();

((ColumnHeaderRenderer)headerRenderer).applyProperties(headerProperties);
}
else {
return ColumnHeaderRenderer.getSharedInstance();
}
}
return headerRenderer;
}

When using JNTable (which itself uses JXTable), i dont see any way to
replace the ColumnHeaderRenderer with my own class. Of course i dont
want to change deeper classes like TableColumnExt or JXTable, because
then i have problems with every new release of JDNC.

My code looks like this:

JNTable table2;
table2 = new JNTable(wordsTableModel);
table2.setHasColumnControl(true);
table2.setOddRowBackground(Color.yellow);
table2.setShowVerticalLines(true);
JXTable table = table2.getTable();

so i can get back the currently used JXTable instance, but there must be
a way to define that i want to use a different HeaderRenderer for all my
columns. It would be great of course if i can submit my own renderer on
construction time (getHeaderRenderer()), but this method above is not
very plugable.

--
regards
Marc Logemann
http://www.logemann.org
http://www.logentis.de

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net