deep-c-rsc/JCGO/examples/jdk142_DrawTest-src.diff
2021-07-16 17:12:20 -05:00

29 lines
902 B
Diff

diff -ruN original/DrawTest.java modified/DrawTest.java
--- original/DrawTest.java 2008-11-10 23:31:58.000000000 +0400
+++ modified/DrawTest.java 2009-07-09 17:29:42.000000000 +0400
@@ -62,6 +62,11 @@
public static void main(String args[]) {
Frame f = new Frame("DrawTest");
+
+ f.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) { System.exit(0); }
+ });
+
DrawTest drawTest = new DrawTest();
drawTest.init();
drawTest.start();
@@ -194,6 +199,12 @@
DrawPanel target;
public DrawControls(DrawPanel target) {
+ Button button = new Button("Quit");
+ button.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) { System.exit(0); }
+ });
+ add(button);
+
this.target = target;
setLayout(new FlowLayout());
setBackground(Color.lightGray);