com.jgoodies.validation.tutorial.util
Class TutorialApplication

java.lang.Object
  extended by com.jgoodies.validation.tutorial.util.TutorialApplication
Direct Known Subclasses:
ComponentFeedbackExample, DateExample, FocusLostBehaviorExample, InfoOnFocusExample, MandatoryMarkerExample, NumberExample, PerformanceExample, SimpleDomainValidationExample, ValidatingOrderEditor, ValidationMessageKeysExample, ValidationResultViewExample, ValidationTimeExample

public abstract class TutorialApplication
extends Object

A base class for tutorial applications. It provides a light version of the startup behavior from the JSR 296 "Swing Application Framework".

Version:
$Revision: 1.2 $
Author:
Karsten Lentzsch

Constructor Summary
protected TutorialApplication()
           
 
Method Summary
protected  JFrame createFrame(String title)
           
protected  void initializeLookAndFeel()
           
static void launch(Class<? extends TutorialApplication> appClass, String... args)
          Instantiates the given TutorialApplication class, then invokes #startup with the given arguments.
protected  void locateOnOpticalScreenCenter(Component component)
          Locates the given component on the screen's center.
protected  void packAndShowOnScreenCenter(JFrame frame)
           
protected abstract  void startup(String[] args)
          Starts this application when the application is launched.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TutorialApplication

protected TutorialApplication()
Method Detail

launch

public static void launch(Class<? extends TutorialApplication> appClass,
                          String... args)
Instantiates the given TutorialApplication class, then invokes #startup with the given arguments. Typically this method is called from an application's #main method.

Parameters:
appClass - the class of the application to launch
args - optional launch arguments, often the main method's arguments.

startup

protected abstract void startup(String[] args)
Starts this application when the application is launched. A typical application creates and shows the GUI in this method. This method runs on the event dispatching thread.

Called by the static launch method.

Parameters:
args - optional launch arguments, often the main method's arguments.
See Also:
launch(Class, String[])

initializeLookAndFeel

protected void initializeLookAndFeel()

createFrame

protected JFrame createFrame(String title)

packAndShowOnScreenCenter

protected final void packAndShowOnScreenCenter(JFrame frame)

locateOnOpticalScreenCenter

protected final void locateOnOpticalScreenCenter(Component component)
Locates the given component on the screen's center.

Parameters:
component - the component to be centered


Copyright © 2003-2008 JGoodies Karsten Lentzsch. All Rights Reserved.