1 package net.sourceforge.importscrubber; 2 3 import java.awt.Component ; 4 import java.awt.Font ; 5 import javax.swing.*; 6 7 10 public class WorkingCellRenderer extends DefaultListCellRenderer implements ListCellRenderer 11 { 12 13 private final Font _bold = new Font ("Arial", Font.BOLD, 10); 14 private final Font _normal = new Font ("Arial", Font.PLAIN, 10); 15 16 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) 17 { 18 super.getListCellRendererComponent(list,value,index,isSelected,cellHasFocus); 19 if (isSelected) { 20 setBorder(BorderFactory.createRaisedBevelBorder()); 21 setFont(_bold); 22 } else { 23 setBorder(BorderFactory.createEmptyBorder()); 24 setFont(_normal); 25 } 26 return this; 27 } 28 } 29 30 | Popular Tags |