package com.annimon.jecp.se;

import com.annimon.jecp.ApplicationListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JFrame;
import javax.swing.WindowConstants;

/**
 *
 * @author aNNiMON
 */
public abstract class JecpApplication extends JFrame implements ApplicationListener, WindowListener {
    
    private final JecpPaintPanel panel;

    public JecpApplication(int width, int height) {
        addWindowListener(JecpApplication.this);
        setLocationByPlatform(true);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        
        onStartApp(width, height);
        panel = new JecpPaintPanel(this, width, height);
        add(panel);
        pack();
        
        setVisible(true);
    }

    @Override
    public void windowClosing(WindowEvent e) {
        onDestroyApp();
    }
    
    @Override
    public void windowDeactivated(WindowEvent e) {
        onPauseApp();
    }
    
    @Override
    public void windowOpened(WindowEvent e) { }

    @Override
    public void windowClosed(WindowEvent e) { }
    
    @Override
    public void windowIconified(WindowEvent e) { }

    @Override
    public void windowDeiconified(WindowEvent e) { }

    @Override
    public void windowActivated(WindowEvent e) { }
    
}

@@ -315,29 +315,8 @@
 nts 
-ApplicationListener, 
 Wind
@@ -329,24 +329,73 @@
 ener %7B%0D%0A    
+%0D%0A    private final ApplicationListener listener;
 %0D%0A    privat
@@ -458,32 +458,97 @@
 ion(
-int width, int height) %7B
+ApplicationListener listener, int width, int height) %7B%0D%0A        this.listener = listener;
 %0D%0A  
@@ -717,16 +717,25 @@
         
+listener.
 onStartA
@@ -789,20 +789,24 @@
 ntPanel(
-this
+listener
 , width,
@@ -971,16 +971,25 @@
         
+listener.
 onDestro
@@ -1085,16 +1085,25 @@
         
+listener.
 onPauseA

Change JecpApllication class in JECP-SE