* @param c the component to be displayed
* @param name the name used as a dialog title
* @return the dialog
*/
protected JDialog createDialog(final Component c, String name){
JDialog jd=new JDialog(owner, name);
jd.getContentPane().add(c);
jd.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
jd.addWindowListener(new WindowAdapter(){
public void windowClosed(WindowEvent e) {
Element el=getElement(c);
changeElement(c,el.previousMode);
}
});
jd.pack();
jd.show();
return jd;
}