public static JPanel createErrorComponent(String error){
  JPanel panel=new JPanel(new BorderLayout());
  JLabel label=new JLabel(error,ERROR_ICON,SwingConstants.CENTER);
  panel.add(label,BorderLayout.CENTER);
  return panel;
}

public static JPanel createErrorComponent ( String error ) { JPanel panel = new JPanel ( new BorderLayout ( ) ) ; JLabel label = new JLabel ( error , ERROR_ICON , SwingConstants . CENTER ) ; panel . add ( label , BorderLayout . CENTER ) ; return panel ; }
creates a panel which centers an error message .
