public static JLabel initializeHelpLabel(JPanel labelPanel){
  JPanel helpPanel=new JPanel();
  helpPanel.setLayout(new GridBagLayout());
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.anchor=GridBagConstraints.NORTH;
  gbc.weightx=1.0;
  gbc.fill=GridBagConstraints.HORIZONTAL;
  gbc.insets=new Insets(0,3,0,0);
  final JLabel helpLabel=new JLabel();
  helpLabel.setIcon(createIcon(HELP_ICON_PATH));
  helpLabel.setFocusable(false);
  gbc.anchor=GridBagConstraints.CENTER;
  helpPanel.add(helpLabel,gbc);
  gbc.gridy+=1;
  gbc.fill=GridBagConstraints.HORIZONTAL;
  gbc.weighty=1.0;
  gbc.insets=new Insets(0,0,0,0);
  helpPanel.add(new JLabel(),gbc);
  labelPanel.add(helpPanel,BorderLayout.EAST);
  return helpLabel;
}

public static JLabel initializeHelpLabel ( JPanel labelPanel ) { JPanel helpPanel = new JPanel ( ) ; helpPanel . setLayout ( new GridBagLayout ( ) ) ; GridBagConstraints gbc = new GridBagConstraints ( ) ; gbc . anchor = GridBagConstraints . NORTH ; gbc . weightx = 1.0 ; gbc . fill = GridBagConstraints . HORIZONTAL ; gbc . insets = new Insets ( 0 , 3 , 0 , 0 ) ; final JLabel helpLabel = new JLabel ( ) ; helpLabel . setIcon ( createIcon ( HELP_ICON_PATH ) ) ; helpLabel . setFocusable ( false ) ; gbc . anchor = GridBagConstraints . CENTER ; helpPanel . add ( helpLabel , gbc ) ; gbc . gridy += 1 ; gbc . fill = GridBagConstraints . HORIZONTAL ; gbc . weighty = 1.0 ; gbc . insets = new Insets ( 0 , 0 , 0 , 0 ) ; helpPanel . add ( new JLabel ( ) , gbc ) ; labelPanel . add ( helpPanel , BorderLayout . EAST ) ; return helpLabel ; }
creates a helplabel and adds it to the labelpanel . the helplabel shows a help icon .
