Beispiel #1
0
 public Component getListCellRendererComponent(
     JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
   Testable testCase = (Testable) value;
   setText(testName(testCase));
   setOpaque(true);
   setIcon(testCase.isPassed() ? tickIcon : (testCase.isFailed() ? crossIcon : clearIcon));
   if (isSelected) {
     setBackground(list.getSelectionBackground());
     setForeground(list.getSelectionForeground());
   } else {
     setBackground(list.getBackground());
     setForeground(list.getForeground());
   }
   setEnabled(list.isEnabled());
   setFont(list.getFont());
   return this;
 }