*/
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);
}