private void hideableLabel(JLabel label,String text){
  if (text.isEmpty()) {
    label.setForeground(LABEL_INVISIBLE);
  }
 else {
    label.setForeground(LABEL_VISIBLE);
    label.setText(text);
  }
}

private void hideableLabel ( JLabel label , String text ) { if ( text . isEmpty ( ) ) { label . setForeground ( LABEL_INVISIBLE ) ; } else { label . setForeground ( LABEL_VISIBLE ) ; label . setText ( text ) ; } }
changes the text on the given label , making it invisible if the text is empty or visible again otherwise .
