/[classpath]/classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by trebligd, Fri Sep 16 10:52:05 2005 UTC revision 1.7 by trebligd, Sun Sep 18 15:50:52 2005 UTC
# Line 49  import javax.swing.JList; Line 49  import javax.swing.JList;
49  import javax.swing.ListCellRenderer;  import javax.swing.ListCellRenderer;
50  import javax.swing.SwingConstants;  import javax.swing.SwingConstants;
51  import javax.swing.SwingUtilities;  import javax.swing.SwingUtilities;
 import javax.swing.UIDefaults;  
 import javax.swing.UIManager;  
52  import javax.swing.border.Border;  import javax.swing.border.Border;
53  import javax.swing.border.EmptyBorder;  import javax.swing.border.EmptyBorder;
54    
# Line 74  public class BasicComboBoxRenderer Line 72  public class BasicComboBoxRenderer
72    public BasicComboBoxRenderer()    public BasicComboBoxRenderer()
73    {    {
74      setHorizontalAlignment(SwingConstants.LEFT);      setHorizontalAlignment(SwingConstants.LEFT);
75        setBorder(noFocusBorder);
76    }    }
77    
78    /**    /**
# Line 129  public class BasicComboBoxRenderer Line 128  public class BasicComboBoxRenderer
128            
129      setOpaque(true);      setOpaque(true);
130    
131      if (isSelected)      if (isSelected || cellHasFocus)
132        {        {
133          setBackground(list.getSelectionBackground());          setBackground(list.getSelectionBackground());
134          setForeground(list.getSelectionForeground());          setForeground(list.getSelectionForeground());
# Line 142  public class BasicComboBoxRenderer Line 141  public class BasicComboBoxRenderer
141    
142      setEnabled(list.isEnabled());      setEnabled(list.isEnabled());
143      setFont(list.getFont());      setFont(list.getFont());
   
     // Use focusCellHighlightBorder when renderer has focus and  
     // noFocusBorder otherwise  
     if (cellHasFocus)  
       setBorder(UIManager.getBorder("List.focusCellHighlightBorder"));  
     else  
       setBorder(noFocusBorder);  
   
144      return this;      return this;
145    }    }
146    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26