|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.aplu.util.ModelessOptionPane
public class ModelessOptionPane
Modeless message dialog using Swing JOptionPane.
Useful to show text and/or images while the application continues to run.
All Swing methods are invoked in the EDT.
Field Summary | |
---|---|
static java.net.URL |
ICON_EXCLAMATION
URL to display the exclamation icon. |
Constructor Summary | |
---|---|
ModelessOptionPane(java.awt.Frame owner,
int ulx,
int uly,
java.awt.Dimension size,
boolean isDecorated)
Same as general constructor, but with no text, no icon and no button, given dimension and selectable decoration. |
|
ModelessOptionPane(int ulx,
int uly,
java.lang.String text)
Same as general constructor, but with no icon and no button. |
|
ModelessOptionPane(int ulx,
int uly,
java.lang.String text,
java.net.URL iconUrl)
Same as ModelessOptionPane(ulx, uly, text, iconUrl, buttonText), but with no button. |
|
ModelessOptionPane(int ulx,
int uly,
java.lang.String text,
java.net.URL iconUrl,
java.lang.String buttonText)
General constructor that show a modeless message dialog at given position (upper left corner) containing given text and given icon image (gif or jpg). iconUrl is the URL for the icon resource. |
|
ModelessOptionPane(java.lang.String text)
Same as general constructor, but with no icon and no button and dialog centered in middle of screen. |
|
ModelessOptionPane(java.lang.String text,
java.net.URL iconUrl)
Same as general constructor, but with no button and dialog centered in middle of the screen. |
|
ModelessOptionPane(java.lang.String text,
java.net.URL iconUrl,
java.lang.String buttonText)
Same as general constructor, but dialog centered in middle of the screen. |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Register a ActionListener to get a notification when the button is hit. |
void |
addCleanable(Cleanable cl)
Register a class with a method clean() that will be called when the title bar's close button is hit. |
void |
dispose()
Dispose the dialog |
javax.swing.JDialog |
getDialog()
Return the dialog. |
boolean |
isVisible()
Return true, if dialog is visible; otherwise false. |
void |
requestFocus()
Request the focus. |
void |
setButtonEnabled(boolean enable)
Enable/disable the button (if any). |
void |
setText(java.lang.String text)
Display the given text. |
void |
setText(java.lang.String text,
boolean adjust)
Same as setText() but select whether to adjust size of dialog. |
void |
setTitle(java.lang.String title)
Same as showTitle(). |
void |
setVisible(boolean visible)
Show/hide the dialog. |
void |
showTitle(java.lang.String title)
Show the given title in the title bar. |
void |
toFront()
Bring the dialog to the front. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.net.URL ICON_EXCLAMATION
Constructor Detail |
---|
public ModelessOptionPane(int ulx, int uly, java.lang.String text, java.net.URL iconUrl, java.lang.String buttonText)
ClassLoader loader = getClass().getClassLoader();
URL iconUrl = loader.getResource(iconResource);
public ModelessOptionPane(int ulx, int uly, java.lang.String text, java.net.URL iconUrl)
public ModelessOptionPane(int ulx, int uly, java.lang.String text)
public ModelessOptionPane(java.awt.Frame owner, int ulx, int uly, java.awt.Dimension size, boolean isDecorated)
public ModelessOptionPane(java.lang.String text, java.net.URL iconUrl)
public ModelessOptionPane(java.lang.String text, java.net.URL iconUrl, java.lang.String buttonText)
public ModelessOptionPane(java.lang.String text)
Method Detail |
---|
public void addActionListener(java.awt.event.ActionListener listener)
public void setText(java.lang.String text)
public void setText(java.lang.String text, boolean adjust)
public void showTitle(java.lang.String title)
public void setTitle(java.lang.String title)
public void setButtonEnabled(boolean enable)
public void addCleanable(Cleanable cl)
public void dispose()
public javax.swing.JDialog getDialog()
public void setVisible(boolean visible)
public boolean isVisible()
public void toFront()
public void requestFocus()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |