コード例 #1
0
 @Override
 public Integer getValue() {
   QuestNode node = (QuestNode) getSelectedItem();
   if (node != null) {
     return node.getIntID();
   }
   return -1;
 }
コード例 #2
0
 @Override
 public Component getListCellRendererComponent(
     JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
   super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
   QuestNode node = (QuestNode) value;
   if (node != null) {
     super.setIcon(node.getIcon(false));
     super.setText(node.toString());
   }
   return this;
 }