Exemple #1
0
 public Component getListCellRendererComponent(
     JList<? extends OPath> list, // the list
     OPath value, // value to display
     int index, // cell index
     boolean isSelected, // is the cell selected
     boolean cellHasFocus) // does the cell have focus
     {
   String s = value.getDescription();
   setText(s);
   if (isSelected) {
     setBackground(list.getSelectionBackground());
     setForeground(list.getSelectionForeground());
   } else {
     setBackground(list.getBackground());
     setForeground(list.getForeground());
   }
   setEnabled(list.isEnabled());
   setFont(list.getFont());
   setOpaque(true);
   return this;
 }