カスタム ListCellRenderer を書きたいと思います。
デフォルトのものと異なる必要があるのは、 の戻り値を表示するのではなく、 の戻り値を表示することだけvalue.toString()
ですvalue.myOwnCustomMethodThatReturnsString()
。
それを行う最も簡単な方法は何ですか?
これがすべて含まれているクラスは、すでに ListCellRenderer を実装しており、次のものがあります。
public Component getListCellRendererComponent(JList<? extends Chapter> list,
Chapter value, int index, boolean isSelected, boolean cellHasFocus)
{
return null;
}
括弧の間に何を入れればいいのかわかりません...