public static JPanel createHorizontalPanel(String title){
  JPanel panel=new JPanel();
  panel.setLayout(new GridLayout(1,0));
  if (title != null) {
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),title));
  }
 else {
    panel.setBorder(BorderFactory.createEtchedBorder());
  }
  return panel;
}

public static JPanel createHorizontalPanel ( String title ) { JPanel panel = new JPanel ( ) ; panel . setLayout ( new GridLayout ( 1 , 0 ) ) ; if ( title != null ) { panel . setBorder ( BorderFactory . createTitledBorder ( BorderFactory . createEtchedBorder ( ) , title ) ) ; } else { panel . setBorder ( BorderFactory . createEtchedBorder ( ) ) ; } return panel ; }
create a panel that does horizontal layout
