net.sourceforge.jiu.gui.awt.dialogs
Class WindowSizeDialog
Dialog
net.sourceforge.jiu.gui.awt.dialogs.WindowSizeDialog
- ActionListener, KeyListener
public class WindowSizeDialog
extends Dialog
implements ActionListener, KeyListener
A dialog to enter values for the width and height of a window (typically
for a spatial filter like median or mean.
cancel
private Button cancel
height
private TextField height
pressedOk
private boolean pressedOk
width
private TextField width
WindowSizeDialog
public WindowSizeDialog(Frame owner,
Strings strings,
int titleIndex,
int initialWidth,
int initialHeight)
owner
- the Frame this dialog will belong to
actionPerformed
public void actionPerformed(ActionEvent e)
Hides (closes) this dialog if the OK button was source of the action event
(e.g. if the button was pressed).
getHeightValue
public int getHeightValue()
getValue
private int getValue(TextComponent textField)
Attempts to convert the content of the argument text component
to an int
; if successful, returns that int, otherwise
-1000 is returned.
textField
- the text component that is supposed to hold an int value
- int representation of the text component's data
getWidthValue
public int getWidthValue()
hasPressedOk
public boolean hasPressedOk()
keyPressed
public void keyPressed(KeyEvent e)
keyReleased
public void keyReleased(KeyEvent e)
keyTyped
public void keyTyped(KeyEvent e)
updateOkButton
private void updateOkButton()