|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectStandardDialog
public final class StandardDialog
Standard dialog, centralizing various display policies.
Using a standard class for all dialogs increases the uniformity of the application's appearance, and eliminates code repetition.
This standard dialog has the following characteristics :
OnClose value passed to
the constructor
Taken individually, such policies are relatively minor. Taken as a group, they form an effective way of establish the overall feel of your application.
Login dialogs
Login dialogs represent a special case, since they have no parent JFrame. Thus, they
cannot inherit an icon. In JDK 6, this can be fixed, by adding a method to this class to
specify the icon.
In addition, closing a login dialog should cause the application to exit. However,
JDialog.setDefaultCloseOperation(int) does not allow for that behavior, while
this class does.
This class does not extend JDialog, since it
doesn't need to. As a pleasant side-effect of this choice, the javadoc for this
class is greatly simplified.
| Constructor Summary | |
|---|---|
StandardDialog(JFrame aOwner,
String aTitle,
boolean aIsModal,
OnClose aOnClose,
JPanel aBody,
List<JButton> aButtons)
Construct a standard dialog. |
|
| Method Summary | |
|---|---|
void |
display()
Display the dialog. |
void |
dispose()
Call dispose on the underlying dialog object. |
JDialog |
getDialog()
Return the underlying dialog object. |
void |
setDefaultButton(JButton aButton)
Assign a default button for this dialog. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StandardDialog(JFrame aOwner,
String aTitle,
boolean aIsModal,
OnClose aOnClose,
JPanel aBody,
List<JButton> aButtons)
aOwner - the frame which is the owner/caller/parent of this dialog. This dialog
gets its icon and its position from the owner. Possibly null. It's strongly recommened to use
a non-null owner.aTitle - the text to appear on the title bar of this dialogaIsModal - controls whether this dialog is modal: if true, then this
dialog must be dismissed before you are allowed to return to the main window.aOnClose - specifies desired behavior when this dialog closesaBody - the body of the dialog, where the user enters informationaButtons - a row of buttons appearing at the bottom of this dialog| Method Detail |
|---|
public void display()
The dialog is not automatically displayed in the constructor. This is because some callers may want to build a dialog upon startup, but only display it later. (Such a style might be chosen in order to slightly improve the apparent responsiveness of the application.)
public void setDefaultButton(JButton aButton)
public void dispose()
public JDialog getDialog()
|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||