com.jstatcom.component
Class TopFrameReference

java.lang.Object
  extended by com.jstatcom.component.TopFrameReference

public final class TopFrameReference
extends java.lang.Object

Class that simply holds a globally accessable reference to the top frame of the application. This needs to be accessed by classes that show messages that should be modal and centered on the screen. The reference should be set at program start. This class is a Singleton.

Author:
Markus Kraetzig

Method Summary
static javax.swing.JFrame getTopFrameRef()
          Gets the top-level reference.
static void setTopFrameRef(javax.swing.JFrame newTopFrameRef)
          Set the reference to the top-level frame of the application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTopFrameRef

public static javax.swing.JFrame getTopFrameRef()
Gets the top-level reference.

Returns:
the top reference

setTopFrameRef

public static void setTopFrameRef(javax.swing.JFrame newTopFrameRef)
Set the reference to the top-level frame of the application. The reference can only be once to make sure that it is a Singleton. This method is not thread-safe.

Parameters:
newTopFrameRef - the new top frame
Throws:
java.lang.IllegalStateException - if the reference was set before