public final class MainWindow extends Object
A menu bar, and a sortable table containing the user's list of movies.
Some applications would add a confirmation dialog when the user exits.
Modifier and Type | Method and Description |
---|---|
void |
buildAndShow(String aUserName)
Build and display the main window.
|
static MainWindow |
getInstance()
Return an instance of this class.
|
String |
getUserName()
Return the user name passed to
buildAndShow(String) . |
void |
refreshView()
Refresh the display in response to changing database content.
|
public static MainWindow getInstance()
This class is made a singleton, since there is only one main window. Any caller can refresh the main window using
MainWindow.getInstance().refreshView();This lets the app avoid needing to pass around an object reference to the main window.
public void buildAndShow(String aUserName)
aUserName
- user name, as validated by
LoginController
.public void refreshView()
public String getUserName()
buildAndShow(String)
.
The user name can be accessed anywhere using :
MainWindow.getInstance().getUserName();
Copyright Hirondelle Systems - Generated 2013Sep20.11.16