public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus){
  ListCellRenderer renderer=comboBox.getRenderer();
  Component c;
  if (hasFocus && !isPopupVisible(comboBox)) {
    c=renderer.getListCellRendererComponent(listBox,comboBox.getSelectedItem(),-1,true,false);
  }
 else {
    c=renderer.getListCellRendererComponent(listBox,comboBox.getSelectedItem(),-1,false,false);
    c.setBackground(UIManager.getColor("ComboBox.background"));
  }
  c.setFont(comboBox.getFont());
  if (hasFocus && !isPopupVisible(comboBox)) {
    c.setForeground(listBox.getSelectionForeground());
    c.setBackground(listBox.getSelectionBackground());
  }
 else {
    if (comboBox.isEnabled()) {
      c.setForeground(comboBox.getForeground());
      c.setBackground(comboBox.getBackground());
    }
 else {
      c.setForeground(DefaultLookup.getColor(comboBox,this,"ComboBox.disabledForeground",null));
      c.setBackground(DefaultLookup.getColor(comboBox,this,"ComboBox.disabledBackground",null));
    }
  }
  boolean shouldValidate=false;
  if (c instanceof JPanel) {
    shouldValidate=true;
  }
  int x=bounds.x, y=bounds.y, w=bounds.width, h=bounds.height;
  if (padding != null) {
    x=bounds.x + padding.left;
    y=bounds.y + padding.top;
    w=bounds.width - (padding.left + padding.right);
    h=bounds.height - (padding.top + padding.bottom);
  }
  currentValuePane.paintComponent(g,c,comboBox,x,y,w,h,shouldValidate);
}

public void paintCurrentValue ( Graphics g , Rectangle bounds , boolean hasFocus ) { ListCellRenderer renderer = comboBox . getRenderer ( ) ; Component c ; if ( hasFocus && ! isPopupVisible ( comboBox ) ) { c = renderer . getListCellRendererComponent ( listBox , comboBox . getSelectedItem ( ) , - 1 , true , false ) ; } else { c = renderer . getListCellRendererComponent ( listBox , comboBox . getSelectedItem ( ) , - 1 , false , false ) ; c . setBackground ( UIManager . getColor ( "ComboBox.background" ) ) ; } c . setFont ( comboBox . getFont ( ) ) ; if ( hasFocus && ! isPopupVisible ( comboBox ) ) { c . setForeground ( listBox . getSelectionForeground ( ) ) ; c . setBackground ( listBox . getSelectionBackground ( ) ) ; } else { if ( comboBox . isEnabled ( ) ) { c . setForeground ( comboBox . getForeground ( ) ) ; c . setBackground ( comboBox . getBackground ( ) ) ; } else { c . setForeground ( DefaultLookup . getColor ( comboBox , this , "ComboBox.disabledForeground" , null ) ) ; c . setBackground ( DefaultLookup . getColor ( comboBox , this , "ComboBox.disabledBackground" , null ) ) ; } } boolean shouldValidate = false ; if ( c instanceof JPanel ) { shouldValidate = true ; } int x = bounds . x , y = bounds . y , w = bounds . width , h = bounds . height ; if ( padding != null ) { x = bounds . x + padding . left ; y = bounds . y + padding . top ; w = bounds . width - ( padding . left + padding . right ) ; h = bounds . height - ( padding . top + padding . bottom ) ; } currentValuePane . paintComponent ( g , c , comboBox , x , y , w , h , shouldValidate ) ; }
paints the currently selected item .
