Sketecher
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of illustration. * * * * Please direct all inquiries to saqib at mycplus.com * *******************************************************/ import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Sketcher implements WindowListener { public static void main(String st[]) { ec=new EventClass(); ec.init(); } public void init() { window=new EventClass("Event Class"); Toolkit tk=window.getToolkit(); Dimension d=tk.getScreenSize(); window.setBounds(d.width/3,d.height/3,d.width/3,d.height/3); window.addWindowListener(this); window.setVisible(true); } public void windowClosing(WindowEvent e) { window.dispose(); System.exit(0); } public void windowOpened(WindowEvent e){} public void windowClosed(WindowEvent e){} public void windowIconified(WindowEvent e){} public void windowDeiconified(WindowEvent e){} public void windowActivated(WindowEvent e){} public void windowDeactivated(WindowEvent e){} private static Sketcher ec; private static SketchFrame window; } |