JXTreeTable の行全体を太字にしようとしています。
final TableCellRenderer doubleOldTableCellRenderer = this.buyTreeTable.getDefaultRenderer(Double.class);
final TableCellRenderer integerOldTableCellRenderer = this.buyTreeTable.getDefaultRenderer(Integer.class);
final TableCellRenderer treeTableModelOldTableCellRenderer = this.buyTreeTable.getDefaultRenderer(TreeTableModel.class);
// "treeTableModelOldTableCellRenderer = null"
System.out.println("treeTableModelOldTableCellRenderer = " + treeTableModelOldTableCellRenderer);
this.buyTreeTable.setDefaultRenderer(TreeTableModel.class, new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component c = treeTableModelOldTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
c.setFont(org.yccheok.jstock.gui.Utils.getBoldFont(c.getFont()));
return c;
}
});
this.buyTreeTable.setDefaultRenderer(Integer.class, new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component c = integerOldTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
c.setFont(org.yccheok.jstock.gui.Utils.getBoldFont(c.getFont()));
return c;
}
});
this.buyTreeTable.setDefaultRenderer(Double.class, new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component c = doubleOldTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
c.setFont(org.yccheok.jstock.gui.Utils.getBoldFont(c.getFont()));
//System.out.println(c);
//System.out.println(c.getFont());
return c;
}
});
ただし、ここに私が得る効果があります:
代替テキスト http://sites.google.com/site/yanchengcheok/Home/treetableproblem.png
フォルダ名も太字にする方法を教えてください。
ありがとう