soc.client
Class AskDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by soc.client.AskDialog
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
NewGameOptionsFrame.VersionConfirmDialog, NotifyDialog, SOCBoardPanel.ConfirmAttackPirateFortressDialog, SOCBoardPanel.ConfirmPlaceShipDialog, SOCBoardPanel.MoveRobberConfirmDialog, SOCPlayerInterface.ChooseMoveRobberOrPirateDialog, SOCPlayerInterface.ChooseRobClothOrResourceDialog, SOCPlayerInterface.ResetBoardConfirmDialog, SOCPlayerInterface.ResetBoardVoteDialog, SOCPracticeAskDialog, SOCQuitAllConfirmDialog, SOCQuitConfirmDialog

public abstract class AskDialog
extends java.awt.Dialog
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.lang.Runnable

This is the generic modal dialog to ask players a two- or three-choice question; to present a one-button message, see NotifyDialog.

Since 1.1.07: If dialog text contains \n, multiple lines will be created. If title bar text contains \n, only its first line (before \n) is used.

To react to button presses, override the abstract methods button1Chosen(), button2Chosen(), windowCloseChosen(), and (for a three-choice question) override button3Chosen().

For convenience with EventQueue.invokeLater(Runnable), contains a run() method which calls setVisible(true).

Since:
1.1.00
Author:
Jeremy D Monin <jeremy@nand.net>
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.awt.Button choice1But
          Button for first choice.
protected  java.awt.Button choice2But
          Button for second choice, or null.
protected  java.awt.Button choice3But
          Optional button for third choice, or null.
protected  int choiceDefault
          Default button (0 for none, or button 1, 2, or 3)
protected  boolean didReqFocus
          Have we requested focus yet?
protected  boolean isMsgMultiLine
          Is the prompt multi-line? If so, assume it might be larger than usual, and adjust height when checkSizeAndFocus() is called.
private  boolean isSizeCheckedAlready
          Has checkSizeAndFocus() already set the size of a multi-line dialog?
protected  javax.swing.JComponent msg
          Prompt message Label, or Panel for multi-line prompt (isMsgMultiLine), or null
private static int MSG_BORDER
          Border width around msg.
protected  int padH
          Padding beyond desired size; not known until windowOpened()
protected  int padW
          Padding beyond desired size; not known until windowOpened()
protected  javax.swing.JPanel pBtns
          Button area, for resizing multi-line dialog height in checkSizeAndFocus().
protected  SOCPlayerClient.GameAwtDisplay pcli
          Player client; passed to constructor, not null; used for actions in subclasses when dialog buttons are chosen
protected  SOCPlayerInterface pi
          Player interface; passed to constructor; may be null if the question is related to the entire client, and not to a specific game
protected  int wantH
          Desired size (visible size inside of insets)
protected  int wantW
          Desired size (visible size inside of insets)
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected AskDialog(SOCPlayerClient.GameAwtDisplay cli, java.awt.Frame parentFr, java.lang.String titlebar, java.lang.String prompt, java.lang.String btnText, boolean hasDefault)
          Creates a new AskDialog with one button, not about a specific game.
  AskDialog(SOCPlayerClient.GameAwtDisplay cli, java.awt.Frame parentFr, java.lang.String titlebar, java.lang.String prompt, java.lang.String choice1, java.lang.String choice2, boolean default1, boolean default2)
          Creates a new AskDialog with two buttons, not about a specific game.
  AskDialog(SOCPlayerClient.GameAwtDisplay cli, java.awt.Frame parentFr, java.lang.String titlebar, java.lang.String prompt, java.lang.String choice1, java.lang.String choice2, java.lang.String choice3, int defaultChoice)
          Creates a new AskDialog with one, two, or three buttons, not about a specific game.
  AskDialog(SOCPlayerClient.GameAwtDisplay cli, SOCPlayerInterface gamePI, java.lang.String titlebar, java.lang.String prompt, java.lang.String choice1, java.lang.String choice2, boolean default1, boolean default2)
          Creates a new AskDialog with two buttons, about a specific game.
  AskDialog(SOCPlayerClient.GameAwtDisplay cli, SOCPlayerInterface gamePI, java.lang.String titlebar, java.lang.String prompt, java.lang.String choice1, java.lang.String choice2, java.lang.String choice3, int defaultChoice)
          Creates a new AskDialog with three buttons, about a specific game.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          A button has been chosen by the user.
abstract  void button1Chosen()
          Button 1 has been chosen by the user.
abstract  void button2Chosen()
          Button 2 has been chosen by the user.
 void button3Chosen()
          The optional button 3 has been chosen by the user.
protected  void checkSizeAndFocus()
          Adjust size (vs insets) and set focus to the default button (if any).
static java.lang.String firstLine(java.lang.String f)
          Extract the first line (up to \n) if f is multi-line.
static java.awt.Frame getParentFrame(java.awt.Component c)
          Gets the top-level frame of c.
 void keyPressed(java.awt.event.KeyEvent e)
          Handle Enter or Esc key
 void keyReleased(java.awt.event.KeyEvent arg0)
          Stub required by KeyListener
 void keyTyped(java.awt.event.KeyEvent arg0)
          Stub required by KeyListener
 void mouseClicked(java.awt.event.MouseEvent e)
          Stub required by MouseListener
 void mouseEntered(java.awt.event.MouseEvent e)
          Check versus minimum size: calls (@link #checkSizeAndFocus()}
 void mouseExited(java.awt.event.MouseEvent e)
          Stub required by MouseListener
 void mousePressed(java.awt.event.MouseEvent e)
          Stub required by MouseListener
 void mouseReleased(java.awt.event.MouseEvent e)
          Stub required by MouseListener
 void run()
          In the AWT event thread, show ourselves.
static void styleAsDefault(java.awt.Button b)
          Since we can't designate as default visually through the standard AWT API, try to bold the button text or set its color to white.
 void windowActivated(java.awt.event.WindowEvent e)
          Stub required by WindowListener
abstract  void windowCloseChosen()
          The dialog window was closed by the user, or ESC was pressed.
 void windowClosed(java.awt.event.WindowEvent e)
          Stub required by WindowListener
 void windowClosing(java.awt.event.WindowEvent e)
          Dialog close requested by user.
 void windowDeactivated(java.awt.event.WindowEvent e)
          Stub required by WindowListener
 void windowDeiconified(java.awt.event.WindowEvent e)
          Stub required by WindowListener
 void windowIconified(java.awt.event.WindowEvent e)
          Stub required by WindowListener
 void windowOpened(java.awt.event.WindowEvent e)
          Window is appearing - check the size and the default button keyboard focus
 
Methods inherited from class java.awt.Dialog
addNotify, getAccessibleContext, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MSG_BORDER

private static final int MSG_BORDER
Border width around msg.

See Also:
Constant Field Values

pcli

protected final SOCPlayerClient.GameAwtDisplay pcli
Player client; passed to constructor, not null; used for actions in subclasses when dialog buttons are chosen


pi

protected SOCPlayerInterface pi
Player interface; passed to constructor; may be null if the question is related to the entire client, and not to a specific game


msg

protected javax.swing.JComponent msg
Prompt message Label, or Panel for multi-line prompt (isMsgMultiLine), or null


pBtns

protected final javax.swing.JPanel pBtns
Button area, for resizing multi-line dialog height in checkSizeAndFocus().

Since:
2.0.00

isMsgMultiLine

protected final boolean isMsgMultiLine
Is the prompt multi-line? If so, assume it might be larger than usual, and adjust height when checkSizeAndFocus() is called.

Since:
2.0.00

isSizeCheckedAlready

private boolean isSizeCheckedAlready
Has checkSizeAndFocus() already set the size of a multi-line dialog?

Since:
2.0.00

choice1But

protected final java.awt.Button choice1But
Button for first choice.

See Also:
button1Chosen()

choice2But

protected final java.awt.Button choice2But
Button for second choice, or null.

See Also:
button2Chosen()

choice3But

protected java.awt.Button choice3But
Optional button for third choice, or null.

See Also:
button3Chosen()

choiceDefault

protected final int choiceDefault
Default button (0 for none, or button 1, 2, or 3)


wantW

protected int wantW
Desired size (visible size inside of insets)


wantH

protected int wantH
Desired size (visible size inside of insets)


padW

protected int padW
Padding beyond desired size; not known until windowOpened()


padH

protected int padH
Padding beyond desired size; not known until windowOpened()


didReqFocus

protected boolean didReqFocus
Have we requested focus yet?

Constructor Detail

AskDialog

public AskDialog(SOCPlayerClient.GameAwtDisplay cli,
                 SOCPlayerInterface gamePI,
                 java.lang.String titlebar,
                 java.lang.String prompt,
                 java.lang.String choice1,
                 java.lang.String choice2,
                 boolean default1,
                 boolean default2)
          throws java.lang.IllegalArgumentException
Creates a new AskDialog with two buttons, about a specific game.

Parameters:
cli - Player client interface; will be used for actions in subclasses when dialog buttons are chosen.
gamePI - Current game's player interface; Cannot be null, use the other constructor if not asking about a specific game.
titlebar - Title bar text; if text contains \n, only the portion before \n is used
prompt - Prompting text shown above buttons, or null
choice1 - First choice button text
choice2 - Second choice button text
default1 - First choice is default
default2 - Second choice is default
Throws:
java.lang.IllegalArgumentException - If both default1 and default2 are true, or if any of these is null: cli, gamePI, prompt, choice1, choice2.

AskDialog

protected AskDialog(SOCPlayerClient.GameAwtDisplay cli,
                    java.awt.Frame parentFr,
                    java.lang.String titlebar,
                    java.lang.String prompt,
                    java.lang.String btnText,
                    boolean hasDefault)
             throws java.lang.IllegalArgumentException
Creates a new AskDialog with one button, not about a specific game. For use by NotifyDialog. parentFr cannot be null; use getParentFrame(Component) to find it.

Throws:
java.lang.IllegalArgumentException
Since:
1.1.06

AskDialog

public AskDialog(SOCPlayerClient.GameAwtDisplay cli,
                 java.awt.Frame parentFr,
                 java.lang.String titlebar,
                 java.lang.String prompt,
                 java.lang.String choice1,
                 java.lang.String choice2,
                 boolean default1,
                 boolean default2)
          throws java.lang.IllegalArgumentException
Creates a new AskDialog with two buttons, not about a specific game.

Parameters:
cli - Player client interface; will be used for actions in subclasses when dialog buttons are chosen
parentFr - SOCPlayerClient or other parent frame
titlebar - Title bar text; if text contains \n, only the portion before \n is used
prompt - Prompting text shown above buttons, or null
choice1 - First choice button text
choice2 - Second choice button text
default1 - First choice is default
default2 - Second choice is default
Throws:
java.lang.IllegalArgumentException - If both default1 and default2 are true, or if any of these is null: cli, gamePI, prompt, choice1, choice2.

AskDialog

public AskDialog(SOCPlayerClient.GameAwtDisplay cli,
                 SOCPlayerInterface gamePI,
                 java.lang.String titlebar,
                 java.lang.String prompt,
                 java.lang.String choice1,
                 java.lang.String choice2,
                 java.lang.String choice3,
                 int defaultChoice)
          throws java.lang.IllegalArgumentException
Creates a new AskDialog with three buttons, about a specific game. Also can create with two.

Parameters:
cli - Player client interface; will be used for actions in subclasses when dialog buttons are chosen
gamePI - Current game's player interface
titlebar - Title bar text; if text contains \n, only the portion before \n is used
prompt - Prompting text shown above buttons, or null
choice1 - First choice button text
choice2 - Second choice button text
choice3 - Third choice button text, or null if 2 buttons
defaultChoice - Default button (1, 2, 3, or 0 for none)
Throws:
java.lang.IllegalArgumentException - If defaultChoice out of range 0..3, or if any of these is null: cli, gamePI, prompt, choice1, choice2, or if choice3 is null and defaultChoice is 3.

AskDialog

public AskDialog(SOCPlayerClient.GameAwtDisplay cli,
                 java.awt.Frame parentFr,
                 java.lang.String titlebar,
                 java.lang.String prompt,
                 java.lang.String choice1,
                 java.lang.String choice2,
                 java.lang.String choice3,
                 int defaultChoice)
          throws java.lang.IllegalArgumentException
Creates a new AskDialog with one, two, or three buttons, not about a specific game.

Parameters:
cli - Player client interface; will be used for actions in subclasses when dialog buttons are chosen
parentFr - SOCPlayerClient or other parent frame
titlebar - Title bar text; if text contains \n, only the portion before \n is used
prompt - Prompting text shown above buttons, or null. Can be multi-line, use "\n" within your string to separate them.
choice1 - First choice button text
choice2 - Second choice button text, or null if 1 button
choice3 - Third choice button text, or null if 1 or 2 buttons
defaultChoice - Default button (1, 2, 3, or 0 for none)
Throws:
java.lang.IllegalArgumentException - If defaultChoice out of range 0..3, or if any of these is null: cli, parentFr, prompt, choice1, choice2, or if choice3 is null and defaultChoice is 3.
Method Detail

checkSizeAndFocus

protected void checkSizeAndFocus()
Adjust size (vs insets) and set focus to the default button (if any).


styleAsDefault

public static void styleAsDefault(java.awt.Button b)
Since we can't designate as default visually through the standard AWT API, try to bold the button text or set its color to white.

Parameters:
b - Button to style visually as default. Please add button to dialog layout before calling, so we can query the font.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
A button has been chosen by the user. Call button1Chosen, button2Chosen or button3chosen, and dispose of this dialog.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

button1Chosen

public abstract void button1Chosen()
Button 1 has been chosen by the user. React accordingly. actionPerformed has already called dialog.dispose().


button2Chosen

public abstract void button2Chosen()
Button 2 has been chosen by the user. React accordingly. actionPerformed has already called dialog.dispose().


button3Chosen

public void button3Chosen()
The optional button 3 has been chosen by the user. React accordingly. actionPerformed has already called dialog.dispose(). Please override this empty stub if you have a third button.


windowCloseChosen

public abstract void windowCloseChosen()
The dialog window was closed by the user, or ESC was pressed. React accordingly. AskDialog has already called dialog.dispose().


windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Dialog close requested by user. Dispose and call windowCloseChosen.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Window is appearing - check the size and the default button keyboard focus

Specified by:
windowOpened in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Stub required by WindowListener

Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Stub required by WindowListener

Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Stub required by WindowListener

Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Stub required by WindowListener

Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Stub required by WindowListener

Specified by:
windowIconified in interface java.awt.event.WindowListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Handle Enter or Esc key

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent arg0)
Stub required by KeyListener

Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent arg0)
Stub required by KeyListener

Specified by:
keyTyped in interface java.awt.event.KeyListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Check versus minimum size: calls (@link #checkSizeAndFocus()}

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Stub required by MouseListener

Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Stub required by MouseListener

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Stub required by MouseListener

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Stub required by MouseListener

Specified by:
mouseReleased in interface java.awt.event.MouseListener

getParentFrame

public static java.awt.Frame getParentFrame(java.awt.Component c)
                                     throws java.lang.IllegalStateException
Gets the top-level frame of c. All windows and applets should have one.

Parameters:
c - The Component.
Returns:
The parent-frame
Throws:
java.lang.IllegalStateException - if we find a null parent before a Frame, or if any parent == itself
Since:
1.1.06

firstLine

public static java.lang.String firstLine(java.lang.String f)
Extract the first line (up to \n) if f is multi-line.

Parameters:
f - A string, possibly containing \n. Should not start with \n.
Returns:
f's first line, or all of f if no \n
Since:
1.1.07

run

public void run()
In the AWT event thread, show ourselves. Do not call directly; call EventQueue.invokeLater(thisDialog). This method just calls setVisible(true), and if any error occurs calls Throwable.printStackTrace().

Specified by:
run in interface java.lang.Runnable
Since:
2.0.00