Class ErrorNotificationDialog

  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by com.golden.gamedev.funbox.ErrorNotificationDialog
All Implemented Interfaces:
ActionListener, WindowListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class ErrorNotificationDialog
extends JDialog
implements Runnable, ActionListener, WindowListener

ErrorNotificationDialog class is a dialog UI to show the player the game exception and tell the player to send it to the game author.

See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDialog
Nested classes/interfaces inherited from class java.awt.Dialog
Nested classes/interfaces inherited from class java.awt.Window
Nested classes/interfaces inherited from class java.awt.Container
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
Field Summary
protected  BaseGraphics bsGraphics
          The graphics engine used by the game.
protected  String emailAddress
          The email address which the player should report the exception to.
protected  Throwable error
          The error exception of the game.
protected  JTextArea textArea
          The text area UI where the game exception is printed out.
protected  String title
          The game title.
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Component
Fields inherited from interface javax.swing.WindowConstants
Fields inherited from interface java.awt.image.ImageObserver
Constructor Summary
ErrorNotificationDialog(Throwable error, BaseGraphics bsGraphics, String title, String emailAddress)
          Builds up an error notification dialog for the player.
Method Summary
 void actionPerformed(ActionEvent e)
          Action listener for exit and copy to clipboard button.
 void closeDialog()
          Closes this error notification dialog.
protected  void initGUI()
          The initialization of the error notification GUI.
protected  void printStackTrace()
          Prints exception stack trace along with the system information to the text area.
 void run()
          Thread implementation that actually create the dialog UI used whenever the game is in applet environment.
 void windowActivated(WindowEvent e)
          Do nothing.
 void windowClosed(WindowEvent e)
          Do nothing.
 void windowClosing(WindowEvent e)
          Closes this error notification dialog by calling closeDialog() when the window close button is pressed.
 void windowDeactivated(WindowEvent e)
          Do nothing.
 void windowDeiconified(WindowEvent e)
          Do nothing.
 void windowIconified(WindowEvent e)
          Do nothing.
 void windowOpened(WindowEvent e)
          Do nothing.
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


protected Throwable error
The error exception of the game.

This is the exception that will be notified to the player.


protected BaseGraphics bsGraphics
The graphics engine used by the game.


protected String title
The game title.


protected String emailAddress
The email address which the player should report the exception to.


protected JTextArea textArea
The text area UI where the game exception is printed out.

Constructor Detail


public ErrorNotificationDialog(Throwable error,
                               BaseGraphics bsGraphics,
                               String title,
                               String emailAddress)
Builds up an error notification dialog for the player.

error - the game exception
bsGraphics - the graphics engine of the game
title - the game title
emailAddress - the email address which the player should be reporting the exception to
Method Detail


public void run()
Thread implementation that actually create the dialog UI used whenever the game is in applet environment.

In applet, the dialog UI is created under a daemon thread to avoid the dialog creation interrupting the applet process.

Specified by:
run in interface Runnable
See Also:


protected void printStackTrace()
Prints exception stack trace along with the system information to the text area.

Override this method to add more information about the exception.

See Also:


protected void initGUI()
The initialization of the error notification GUI.


public void actionPerformed(ActionEvent e)
Action listener for exit and copy to clipboard button.

Specified by:
actionPerformed in interface ActionListener


public void closeDialog()
Closes this error notification dialog.

This method will call System.exit(0); if the graphics engine is not instance of Applet class.


public void windowClosing(WindowEvent e)
Closes this error notification dialog by calling closeDialog() when the window close button is pressed.

Specified by:
windowClosing in interface WindowListener
See Also:


public void windowOpened(WindowEvent e)
Do nothing.

Specified by:
windowOpened in interface WindowListener


public void windowClosed(WindowEvent e)
Do nothing.

Specified by:
windowClosed in interface WindowListener


public void windowIconified(WindowEvent e)
Do nothing.

Specified by:
windowIconified in interface WindowListener


public void windowDeiconified(WindowEvent e)
Do nothing.

Specified by:
windowDeiconified in interface WindowListener


public void windowActivated(WindowEvent e)
Do nothing.

Specified by:
windowActivated in interface WindowListener


public void windowDeactivated(WindowEvent e)
Do nothing.

Specified by:
windowDeactivated in interface WindowListener


Copyright © 2003-2005 Golden T Studios. All rights reserved. Use is subject to license terms.