import java.awt.Component;
import java.awt.Container;
import javax.swing.*;
import java.awt.Window;
import java.awt.event.*;

public class demo1
{ 
  
    public static void plot(final String s,final secP b) {
	    javax.swing.SwingUtilities.invokeLater(new Runnable(){
        public void run() 
        {	        
        JFrame frame = new JFrame(s);
        frame.addWindowListener(new WindowAdapter() 
        {
            public void windowClosing(WindowEvent e) 
            {
	        Window w=e.getWindow();
            w.setVisible(false);
            w.dispose();
            if(b.en!=0&&b.boy!=0) b.secim=true;
            else b.secim=false;
            }
        });
        //frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);        
        frame.getContentPane().add(b);
        frame.pack();
        frame.setVisible(true);
        
        }
        });
    }
}
