public abstract class JApplication
extends java.lang.Object
implements javax.swing.RootPaneContainer, java.lang.Runnable, java.awt.event.WindowListener
Specializations of this class must implement the init() method. They may also implement the destroy(), start(), and stop() methods.
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
icondata |
| Constructor and Description |
|---|
JApplication(int width,
int height)
Explicit Value Constructor.
|
JApplication(java.lang.String[] args,
int width,
int height)
Explicit Value Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
This method is called just after the main window is
disposed.
|
java.awt.Container |
getContentPane()
Returns the content pane
(required by RootPaneContainer).
|
java.awt.Component |
getGlassPane()
Returns the glass pane
(required by RootPaneContainer).
|
javax.swing.JLayeredPane |
getLayeredPane()
Returns the layered pane
(required by RootPaneContainer).
|
javax.swing.JRootPane |
getRootPane()
Returns the root pane
(required by RootPaneContainer).
|
abstract void |
init()
This method is called just before the main window
is first made visible.
|
void |
run()
The actual entry point into this JApplication
(required by Runnable).
|
void |
setContentPane(java.awt.Container contentPane)
Set the content pane
(required by RootPaneContainer).
|
void |
setGlassPane(java.awt.Component glassPane)
Set the glass pane
(required by RootPaneContainer).
|
void |
setLayeredPane(javax.swing.JLayeredPane layeredPane)
Set the layered pane
(required by RootPaneContainer).
|
void |
start()
This method is called when the main window is first
made visible and then each time it is de-iconified.
|
void |
stop()
This method is called each time the main window is iconified
and just before it is disposed.
|
void |
windowActivated(java.awt.event.WindowEvent event)
Handle windowActivated messages -- when the windows gains the focus
(required by WindowListener).
|
void |
windowClosed(java.awt.event.WindowEvent event)
Handle windowClosed messages -- when the window is disposed
(required by WindowListener).
|
void |
windowClosing(java.awt.event.WindowEvent event)
Handle windowClosing messages
(required by WindowListener).
|
void |
windowDeactivated(java.awt.event.WindowEvent event)
Handle windowDeactivated messages -- when the windows loses the focus
(required by WindowListener).
|
void |
windowDeiconified(java.awt.event.WindowEvent event)
Handle windowDeiconified messages -- when the window is maximized
(required by WindowListener).
|
void |
windowIconified(java.awt.event.WindowEvent event)
Handle windowIconified messages -- when the window is minimized
(required by WindowListener).
|
void |
windowOpened(java.awt.event.WindowEvent event)
Handle windowOpened messages -- the first time the window is
made visible (required by WindowListener).
|
public JApplication(java.lang.String[] args,
int width,
int height)
args - The command line argumentswidth - The width of the content (in pixels)height - The height of the content (in pixels)public JApplication(int width,
int height)
width - The width of the content (in pixels)height - The height of the content (in pixels)public void destroy()
public java.awt.Container getContentPane()
getContentPane in interface javax.swing.RootPaneContainerpublic java.awt.Component getGlassPane()
getGlassPane in interface javax.swing.RootPaneContainerpublic javax.swing.JLayeredPane getLayeredPane()
getLayeredPane in interface javax.swing.RootPaneContainerpublic javax.swing.JRootPane getRootPane()
getRootPane in interface javax.swing.RootPaneContainerpublic abstract void init()
public final void run()
This method is called in the event dispatch thread.
run in interface java.lang.Runnablepublic void setContentPane(java.awt.Container contentPane)
setContentPane in interface javax.swing.RootPaneContainerpublic void setGlassPane(java.awt.Component glassPane)
setGlassPane in interface javax.swing.RootPaneContainerpublic void setLayeredPane(javax.swing.JLayeredPane layeredPane)
setLayeredPane in interface javax.swing.RootPaneContainerpublic void start()
The default implementation does nothing.
public void stop()
The default implementation does nothing.
public void windowActivated(java.awt.event.WindowEvent event)
windowActivated in interface java.awt.event.WindowListenerevent - The WindowEvent that generated the messagepublic void windowClosed(java.awt.event.WindowEvent event)
windowClosed in interface java.awt.event.WindowListenerevent - The WindowEvent that generated the messagepublic void windowClosing(java.awt.event.WindowEvent event)
windowClosing in interface java.awt.event.WindowListenerevent - The WindowEvent that generated the messagepublic void windowDeiconified(java.awt.event.WindowEvent event)
windowDeiconified in interface java.awt.event.WindowListenerevent - The WindowEvent that generated the messagepublic void windowDeactivated(java.awt.event.WindowEvent event)
windowDeactivated in interface java.awt.event.WindowListenerevent - The WindowEvent that generated the messagepublic void windowIconified(java.awt.event.WindowEvent event)
windowIconified in interface java.awt.event.WindowListenerevent - The WindowEvent that generated the messagepublic void windowOpened(java.awt.event.WindowEvent event)
windowOpened in interface java.awt.event.WindowListenerevent - The WindowEvent that generated the message