diff --git a/src/com/plealog/genericapp/api/EZUIStarterListener.java b/src/com/plealog/genericapp/api/EZUIStarterListener.java index 8573f55..d27fe49 100644 --- a/src/com/plealog/genericapp/api/EZUIStarterListener.java +++ b/src/com/plealog/genericapp/api/EZUIStarterListener.java @@ -32,6 +32,11 @@ public interface EZUIStarterListener { */ public void postStart(); + /** + * This method is called when the application frame has been displayed. + */ + public void frameDisplayed(); + /** * This method is called when application is going to install the user-defined * component within the main frame. diff --git a/src/com/plealog/genericapp/api/test/EZUIStarterTest.java b/src/com/plealog/genericapp/api/test/EZUIStarterTest.java index 0ad28f6..f8ddd93 100644 --- a/src/com/plealog/genericapp/api/test/EZUIStarterTest.java +++ b/src/com/plealog/genericapp/api/test/EZUIStarterTest.java @@ -110,5 +110,9 @@ public Component getApplicationComponent() { public boolean isAboutToQuit() { return true; } + + @Override + public void frameDisplayed() { + } } } diff --git a/src/com/plealog/genericapp/ui/starter/EZUIStarterImplem.java b/src/com/plealog/genericapp/ui/starter/EZUIStarterImplem.java index 99c60bc..037829e 100644 --- a/src/com/plealog/genericapp/ui/starter/EZUIStarterImplem.java +++ b/src/com/plealog/genericapp/ui/starter/EZUIStarterImplem.java @@ -88,6 +88,15 @@ public void run() { EventQueue.invokeLater(runner); } } + + private class UIStarterListenerDisplayedhandler extends Thread { + public void run() { + if(EZEnvironment.getUIStarterListener()!=null){ + EZEnvironment.getUIStarterListener().frameDisplayed(); + } + } + } + private void center(Window frame) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = frame.getSize(); @@ -154,6 +163,7 @@ public void componentMoved(ComponentEvent e) { } }); frame.setVisible(true); + EventQueue.invokeLater(new UIStarterListenerDisplayedhandler()); } } public void startApplication(String[] args){