protected JPanel createTitledPanel(String title){
  JPanel panel=new JPanel(new GridBagLayout());
  Border titleBorder=BorderFactory.createTitledBorder(title);
  panel.setBorder(BorderFactory.createCompoundBorder(titleBorder,PADDING));
  return panel;
}

protected JPanel createTitledPanel ( String title ) { JPanel panel = new JPanel ( new GridBagLayout ( ) ) ; Border titleBorder = BorderFactory . createTitledBorder ( title ) ; panel . setBorder ( BorderFactory . createCompoundBorder ( titleBorder , PADDING ) ) ; return panel ; }
creates a panel with a titled border .
