hades.gui
Class JStringDialog
java.lang.Object
hades.gui.StringDialog
hades.gui.JStringDialog
- All Implemented Interfaces:
- java.util.EventListener, java.awt.event.WindowListener
- public class JStringDialog
- extends StringDialog
- implements java.awt.event.WindowListener
JStringDialog provides a dialog window to get a text string from the user.
It contains a textfield, an "OK", and a "Cancel" button.
The user should enter a valid string (e.g. an URL name) into the textfield
and press either "OK" to confirm the string or "Cancel" to quit.
JStringDialog also implements the WindowListener interface, in order to
return "Cancel" on window-close events.
Field Summary |
(package private) javax.swing.JButton |
cancelButton
|
(package private) javax.swing.JDialog |
dialog
|
(package private) javax.swing.JButton |
okButton
|
(package private) java.awt.Frame |
parent
|
(package private) javax.swing.JTextField |
tf
|
Constructor Summary |
JStringDialog(java.awt.Frame _parent,
java.lang.String title,
java.lang.String prompt)
construct the dialog with given parent, and title and prompt strings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parent
java.awt.Frame parent
dialog
javax.swing.JDialog dialog
tf
javax.swing.JTextField tf
okButton
javax.swing.JButton okButton
cancelButton
javax.swing.JButton cancelButton
JStringDialog
public JStringDialog(java.awt.Frame _parent,
java.lang.String title,
java.lang.String prompt)
- construct the dialog with given parent, and title and prompt strings.
addActionListener
public void addActionListener(java.awt.event.ActionListener AL)
- Specified by:
addActionListener
in class StringDialog
windowActivated
public void windowActivated(java.awt.event.WindowEvent we)
- Specified by:
windowActivated
in interface java.awt.event.WindowListener
windowClosed
public void windowClosed(java.awt.event.WindowEvent we)
- Specified by:
windowClosed
in interface java.awt.event.WindowListener
windowClosing
public void windowClosing(java.awt.event.WindowEvent we)
- Specified by:
windowClosing
in interface java.awt.event.WindowListener
windowDeactivated
public void windowDeactivated(java.awt.event.WindowEvent we)
- Specified by:
windowDeactivated
in interface java.awt.event.WindowListener
windowDeiconified
public void windowDeiconified(java.awt.event.WindowEvent we)
- Specified by:
windowDeiconified
in interface java.awt.event.WindowListener
windowIconified
public void windowIconified(java.awt.event.WindowEvent we)
- Specified by:
windowIconified
in interface java.awt.event.WindowListener
windowOpened
public void windowOpened(java.awt.event.WindowEvent we)
- Specified by:
windowOpened
in interface java.awt.event.WindowListener
setPrompt
public void setPrompt(java.lang.String prompt)
- Specified by:
setPrompt
in class StringDialog
setText
public void setText(java.lang.String s)
- Specified by:
setText
in class StringDialog
getText
public java.lang.String getText()
- Specified by:
getText
in class StringDialog
selectText
public void selectText(boolean b)
- Specified by:
selectText
in class StringDialog
requestFocus
public void requestFocus()
getDialog
public java.awt.Dialog getDialog()
- Specified by:
getDialog
in class StringDialog
getFrame
public java.awt.Frame getFrame()
- Specified by:
getFrame
in class StringDialog
getTextComponent
public java.awt.Component getTextComponent()
- Specified by:
getTextComponent
in class StringDialog