public JDialog displayPanelInWindow(final JPanel panel,String title){
  JDialog frame=new GenericJDialog();
  frame.setContentPane(panel);
  frame.pack();
  frame.setTitle(title);
  frame.setVisible(true);
  return frame;
}

public JDialog displayPanelInWindow ( final JPanel panel , String title ) { JDialog frame = new GenericJDialog ( ) ; frame . setContentPane ( panel ) ; frame . pack ( ) ; frame . setTitle ( title ) ; frame . setVisible ( true ) ; return frame ; }
a copy of displaypanel except returning a subclass of window . here to temporarily resolve ongoing conflict between classes using generic frame and classes using window .
