void (boolean isSelected) { Color bg = isSelected ? UIUtil.getTableSelectionBackground(true) : UIUtil.getTableBackground(); Color fg = isSelected ? UIUtil.getTableSelectionForeground() : UIUtil.getTableForeground(); setColors(bg, fg, myPanel, myNameLabel); }