[Your IP: 23.20.25.122]
Logowanie

Język: PL EN

KySoft Systemy Informatyczne


sitemap
Java
display-properties
lines-intersection-2D
quit-event
usefull-libs
fast file read

C/C++
build-parse-basic
tcp-send-recv
(currently only in english)
Generate ActionEvent on Main window close
final MyPanel panel=new MyPanel();
JFrame f=new JFrame("Window title");
f.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
f.setContentPane(panel);
f.addWindowListener(new WindowAdapter() {
	public void windowClosing(WindowEvent e) {
		panel.actionPerformed(new ActionEvent(e.getSource(),0,"quit"));
	}
});
f.pack();
f.setLocationRelativeTo(null); //center on screen
f.setVisible(true);


Dodaj komentarz