public void setBackground(Color col) { super.setBackground(col); }
public Color getBackground() { if(myindex >= 0) { // Return background for the items in popup if(isselected) { return Color.red; } else { return Color.lightGray; } } else { // For the item not in popup // return the background set by ComboBox return super.getBackground(); } }
public Color getForeground() { if(this.mycolor != null) { return this.mycolor; } else { return super.getForeground(); } }
public Component getListCellRendererComponent(JList pList, Object pValue, int pIndex, boolean pSelected, boolean pHasFocus) { setText((String) pValue);
public void setBackground(Color col) {
super.setBackground(col);
}
public Color getBackground() {
if(myindex >= 0) {
// Return background for the items in popup
if(isselected) {
return Color.red;
} else {
return Color.lightGray;
}
} else {
// For the item not in popup
// return the background set by ComboBox
return super.getBackground();
}
}
public Color getForeground() {
if(this.mycolor != null) {
return this.mycolor;
} else {
return super.getForeground();
}
}
public Component getListCellRendererComponent(JList pList,
Object pValue,
int pIndex,
boolean pSelected,
boolean pHasFocus) {
setText((String) pValue);
public void setBackground(Color col) { super.setBackground(col); }
public Color getBackground() { if(myindex >= 0) { // Return background for the items in popup if(isselected) { return Color.red; } else { return Color.lightGray; } } else { // For the item not in popup // return the background set by ComboBox return super.getBackground(); } }
public Color getForeground() { if(this.mycolor != null) { return this.mycolor; } else { return super.getForeground(); } }
public Component getListCellRendererComponent(JList pList, Object pValue, int pIndex, boolean pSelected, boolean pHasFocus) { setText((String) pValue);
public void setBackground(Color col) { super.setBackground(col); }
public Color getBackground() { if(myindex >= 0) { // Return background for the items in popup if(isselected) { return Color.red; } else { return Color.lightGray; } } else { // For the item not in popup // return the background set by ComboBox return super.getBackground(); } }
public Color getForeground() { if(this.mycolor != null) { return this.mycolor; } else { return super.getForeground(); } }
public Component getListCellRendererComponent(JList pList, Object pValue, int pIndex, boolean pSelected, boolean pHasFocus) { setText((String) pValue);
public void setBackground(Color col) {
super.setBackground(col);
}
public Color getBackground() {
if(myindex >= 0) {
// Return background for the items in popup
if(isselected) {
return Color.red;
} else {
return Color.lightGray;
}
} else {
// For the item not in popup
// return the background set by ComboBox
return super.getBackground();
}
}
public Color getForeground() {
if(this.mycolor != null) {
return this.mycolor;
} else {
return super.getForeground();
}
}
public Component getListCellRendererComponent(JList pList,
Object pValue,
int pIndex,
boolean pSelected,
boolean pHasFocus) {
setText((String) pValue);
public void setBackground(Color col) { super.setBackground(col); }
public Color getBackground() { if(myindex >= 0) { // Return background for the items in popup if(isselected) { return Color.red; } else { return Color.lightGray; } } else { // For the item not in popup // return the background set by ComboBox return super.getBackground(); } }
public Color getForeground() { if(this.mycolor != null) { return this.mycolor; } else { return super.getForeground(); } }
public Component getListCellRendererComponent(JList pList, Object pValue, int pIndex, boolean pSelected, boolean pHasFocus) { setText((String) pValue);