squint
Class GUIManager

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by squint.GUIManager
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, ConnectionListener, TCPListener

public class GUIManager
extends javax.swing.JPanel
implements TCPListener, ConnectionListener

A GUIManager is a set of instructions describing the behavior of GUI Graphical User Interface (GUI) components within a single window on the screen. A simple program can be constructing by writing a single class that extends GUIManager. It is also possible to use the GUIManager class to decribe the behavior of subwindows created dynamically during a programs execution. The constructor for any class that extends GUIManager should create the GUI components used in the program or subwindow's interface and place them within the contentPane. The description of the class should also include definitions of event-handling methods like buttonClicked. that specify how to react to user actions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 java.awt.Container contentPane
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
GUIManager()
          Create a new GUIManger.
 
Method Summary
 void buttonClicked()
          If the program is expected to respond to clicks on buttons displayed in its interface, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program.
 void buttonClicked(javax.swing.JButton button)
          If the program is expected to respond to clicks on buttons displayed in its interface, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void caretRepositioned()
          If the program is expected to respond when the cursor is moved within a JTextField or JTextArea, a version of this method (or one of its namesakes that expects a parameter) that includes code to respond appropriately should be defined as part of the program.
 void caretRepositioned(javax.swing.JTextArea which)
          If the program is expected to respond when the cursor is moved within a JTextField, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void caretRepositioned(javax.swing.JTextField which)
          If the program is expected to respond when the cursor is moved within a JTextField, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void close()
          Close the window (if any) containing this GUIManager.
 void connectionClosed()
          If the program is expected to respond when a network connection is terminated by the remote system, a version of this method (or one of its namesakes) that includes code that will respond appropriately should be defined as part of the program.
 void connectionClosed(NetConnection which)
          If the program is expected to respond when a NetConnection is terminated by the remote system, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void connectionClosed(java.lang.Object which)
          If the program is expected to respond when a NetConnection is terminated by the remote system, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void connectionClosed(TCPConnection which)
          If the program is expected to respond when a TCPConnection is terminated by the remote system, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void connectionEstablished()
          If the program needs to respond whena new connection to one of its TCPPorts is requested, the a version of this method (or its parametered namesake) that includes code that will respond appropriately should be defined as part of the program.
 void connectionEstablished(TCPPort whichPort)
          If the program needs to respond whena new connection to one of its TCPPorts is requested, the a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void createWindow(int width, int height)
          This method is used to create a window on the screen to display the GUI components associated with a GUIManager.
 void createWindow(int width, int height, int closing)
          This method is used to create a window on the screen to display the GUI components associated with a GUIManager.
 void createWindow(int width, int height, java.lang.String title)
          This method is used to create a window on the screen to display the GUI components associated with a GUIManager.
 void createWindow(int width, int height, java.lang.String title, int closing)
          This method is used to create a window on the screen to display the GUI components associated with a GUIManager.
 void dataAvailable()
          If the program is expected to respond when new data is received through a TCPConnection, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program.
 void dataAvailable(NetConnection which)
          If the program is expected to respond when new data is received through a NetConnection, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void dataAvailable(java.lang.Object which)
          If the program is expected to respond when new data is received through a network connection, a version of this method (or one of its namesakes) that includes code that will respond appropriately should be defined as part of the program.
 void dataAvailable(TCPConnection which)
          If the program is expected to respond when new data is received through a TCPConnection, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void focusGained()
          If the program is expected to respond when a some GUI component in the program's interface gains the keyboard focus, a version of this method (or its namesake that expects to be passed the component that gained the focuse as a parameter) that includes code that will respond appropriately should be defined as part of the program.
 void focusGained(java.awt.Component which)
          If the program is expected to respond when a some GUI component in the program's interface gains the keyboard focus, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void focusLost()
          If the program is expected to respond when a some GUI component in the program's interface loses the keyboard focus, a version of this method (or its namesake that expects to be passed the component that gained the focuse as a parameter) that includes code that will respond appropriately should be defined as part of the program.
 void focusLost(java.awt.Component which)
          If the program is expected to respond when a some GUI component in the program's interface loses the keyboard focus, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
static java.lang.String getHostName()
          Returns the IP address or domain name for the machine executing this program
 java.awt.Image getImage(java.lang.String name)
          Access an image file given a string that is a URL or file pathname for the desire image.
 java.awt.Point getLocation()
          Gets the location of this window in the form of a point specifying the window's top-left corner.
 java.awt.Point getLocationOnScreen()
          Gets the location of this window in the form of a point specifying the window's top-left corner in the screen's coordinate space.
 java.awt.Dimension getSize()
          Return the size of this window as a Dimension object.
 java.lang.String getTitle()
          Gets the title of the window.
 javax.swing.JFrame getWindow()
          Access the JFrame within which the GUIManager is displayed on the screen.
 void menuItemSelected()
          If the program is expected to respond when a user selects an item from a JComboBox menu displayed in its interface, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program.
 void menuItemSelected(javax.swing.JComboBox menu)
          If the program is expected to respond when a user selects an item from a JComboBox menu displayed in its interface, a version of this method ( or its paramerless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void mouseClicked()
          If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseClicked(java.awt.Component which, int x, int y)
          If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseClicked(int x, int y)
          If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseClicked(javax.swing.JLabel which, int x, int y)
          If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseClicked(javax.swing.JPanel which, int x, int y)
          If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseDragged()
          If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseDragged(java.awt.Component which, int x, int y)
          If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseDragged(int x, int y)
          If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseDragged(javax.swing.JLabel which, int x, int y)
          If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseDragged(javax.swing.JPanel which, int x, int y)
          If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseEntered()
          If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseEntered(java.awt.Component which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseEntered(int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseEntered(javax.swing.JLabel which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseEntered(javax.swing.JPanel which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseExited()
          If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseExited(java.awt.Component which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseExited(int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseExited(javax.swing.JLabel which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseExited(javax.swing.JPanel which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseMoved()
          If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseMoved(java.awt.Component which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseMoved(int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseMoved(javax.swing.JLabel which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseMoved(javax.swing.JPanel which, int x, int y)
          If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mousePressed()
          If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mousePressed(java.awt.Component which, int x, int y)
          If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mousePressed(int x, int y)
          If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mousePressed(javax.swing.JLabel which, int x, int y)
          If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mousePressed(javax.swing.JPanel which, int x, int y)
          If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseReleased()
          If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseReleased(java.awt.Component which, int x, int y)
          If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseReleased(int x, int y)
          If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseReleased(javax.swing.JLabel which, int x, int y)
          If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void mouseReleased(javax.swing.JPanel which, int x, int y)
          If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.
 void setLocation(int x, int y)
          Moves this window to a new location.
 void setSize(int width, int height)
          Resizes this window.
 void setTitle(java.lang.String title)
          Sets the title for this window to the specified string.
 void setVisible(boolean state)
          Shows or hides this window depending on the value of parameter state.
 void sliderChanged()
          If the program is expected to respond when a user changes the setting of a JSlider displayed in its interface, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program.
 void sliderChanged(javax.swing.JSlider slider)
          If the program is expected to respond when a user changes the setting of a JSlider displayed in its interface, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
 void textEntered()
          If the program is expected to respond when a user finishes entering text within a JTextField displayed in its interface, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program.
 void textEntered(javax.swing.JTextField field)
          If the program is expected to respond when a user finishes entering text within a JTextField displayed in its interface, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.
static java.lang.String version()
          Return the library version description
 void windowClosing()
          If a GUIManager needs to take some action when the user closes its window, a version of this method should be defined that includes the appropriate code.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setName, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contentPane

public java.awt.Container contentPane
Constructor Detail

GUIManager

public GUIManager()
Create a new GUIManger.

Method Detail

version

public static java.lang.String version()
Return the library version description

Returns:
a String describing the version of the library being used

createWindow

public void createWindow(int width,
                         int height,
                         java.lang.String title,
                         int closing)
This method is used to create a window on the screen to display the GUI components associated with a GUIManager.

Parameters:
width - the width of the program window in pixels
height - the height of the program window in pixels
title - the text to place in the window's title bar
closing - Sets the operation that will happen by default when the user initiates a "close" on this GUIManager. You must specify one of the following choices (all defined in WindowConstants): DO_NOTHING_ON_CLOSE: Don't do anything by default; HIDE_ON_CLOSE: Automatically hide the frame after invoking any registered WindowListener objects. DISPOSE_ON_CLOSE: Automatically hide and dispose the window after invoking any registered listener objects. EXIT_ON_CLOSE: Exit the application using the System exit method.

createWindow

public void createWindow(int width,
                         int height,
                         int closing)
This method is used to create a window on the screen to display the GUI components associated with a GUIManager.

Parameters:
width - the width of the program window in pixels
height - the height of the program window in pixels
closing - Sets the operation that will happen by default when the user initiates a "close" on this GUIManager. You must specify one of the following choices (all defined in WindowConstants): DO_NOTHING_ON_CLOSE: Don't do anything by default; HIDE_ON_CLOSE: Automatically hide the frame after invoking any registered WindowListener objects. DISPOSE_ON_CLOSE: Automatically hide and dispose the window after invoking any registered listener objects. EXIT_ON_CLOSE: Exit the application using the System exit method.

createWindow

public void createWindow(int width,
                         int height,
                         java.lang.String title)
This method is used to create a window on the screen to display the GUI components associated with a GUIManager.

Parameters:
width - the width of the program window in pixels
height - the height of the program window in pixels
title - the text to place in the window's title bar

createWindow

public void createWindow(int width,
                         int height)
This method is used to create a window on the screen to display the GUI components associated with a GUIManager.

Parameters:
width - the width of the program window in pixels
height - the height of the program window in pixels

getWindow

public javax.swing.JFrame getWindow()
Access the JFrame within which the GUIManager is displayed on the screen.

Returns:
the window containing this GUIManager.

close

public void close()
Close the window (if any) containing this GUIManager.


setTitle

public void setTitle(java.lang.String title)
Sets the title for this window to the specified string.

Parameters:
title - the title to be displayed in the window's border. A null value is treated as an empty string, "".

getTitle

public java.lang.String getTitle()
Gets the title of the window. The title is displayed in the window's border.

Returns:
the title of this window, or an empty string ("") if this window doesn't have a title.

setVisible

public void setVisible(boolean state)
Shows or hides this window depending on the value of parameter state.

Overrides:
setVisible in class javax.swing.JComponent
Parameters:
state - Passing a value of true makes the window visible, false makes it disappear

setSize

public void setSize(int width,
                    int height)
Resizes this window.

Overrides:
setSize in class java.awt.Component
Parameters:
width - - the new width of this window in pixels
height - - the new height of this window in pixels

getSize

public java.awt.Dimension getSize()
Return the size of this window as a Dimension object.

Overrides:
getSize in class java.awt.Component
Returns:
The current size of the window

setLocation

public void setLocation(int x,
                        int y)
Moves this window to a new location. The top-left corner of the new location is specified by the x and y parameters in the coordinate space of this window's parent.

Overrides:
setLocation in class java.awt.Component
Parameters:
x - the x-coordinate of the new location's top-left corner in the parent's coordinate space
y - the y-coordinate of the new location's top-left corner in the parent's coordinate space

getLocation

public java.awt.Point getLocation()
Gets the location of this window in the form of a point specifying the window's top-left corner. The location will be relative to the parent's coordinate space.

Overrides:
getLocation in class java.awt.Component
Returns:
An instance of Point representing the top-left corner of the window's bounds in the coordinate space of the window's parent

getLocationOnScreen

public java.awt.Point getLocationOnScreen()
Gets the location of this window in the form of a point specifying the window's top-left corner in the screen's coordinate space.

Overrides:
getLocationOnScreen in class java.awt.Component
Returns:
an instance of Point representing the top-left corner of the window's bounds in the coordinate space of the screen
Throws:
java.awt.IllegalComponentStateException - - if the window is not showing on the screen

getImage

public java.awt.Image getImage(java.lang.String name)
Access an image file given a string that is a URL or file pathname for the desire image.

Parameters:
name - the name of the image file

getHostName

public static java.lang.String getHostName()
Returns the IP address or domain name for the machine executing this program


buttonClicked

public void buttonClicked(javax.swing.JButton button)
If the program is expected to respond to clicks on buttons displayed in its interface, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.

Parameters:
button - the button that was clicked

buttonClicked

public void buttonClicked()
If the program is expected to respond to clicks on buttons displayed in its interface, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program.


menuItemSelected

public void menuItemSelected(javax.swing.JComboBox menu)
If the program is expected to respond when a user selects an item from a JComboBox menu displayed in its interface, a version of this method ( or its paramerless namesake) that includes code that will respond appropriately should be defined as part of the program.

Parameters:
menu - the menu from which an item was selected

menuItemSelected

public void menuItemSelected()
If the program is expected to respond when a user selects an item from a JComboBox menu displayed in its interface, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program.


sliderChanged

public void sliderChanged(javax.swing.JSlider slider)
If the program is expected to respond when a user changes the setting of a JSlider displayed in its interface, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.

Parameters:
slider - the slider whose setting was modified

sliderChanged

public void sliderChanged()
If the program is expected to respond when a user changes the setting of a JSlider displayed in its interface, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program.


textEntered

public void textEntered(javax.swing.JTextField field)
If the program is expected to respond when a user finishes entering text within a JTextField displayed in its interface, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program. The method will be invoked when the program's user presses return while typing in a JTextField.

Parameters:
field - the field in which the typing occurred

textEntered

public void textEntered()
If the program is expected to respond when a user finishes entering text within a JTextField displayed in its interface, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program. The method will be invoked when the program's user presses return while typing in a JTextField.


focusGained

public void focusGained(java.awt.Component which)
If the program is expected to respond when a some GUI component in the program's interface gains the keyboard focus, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.

Parameters:
which - The component that gained the focus

focusGained

public void focusGained()
If the program is expected to respond when a some GUI component in the program's interface gains the keyboard focus, a version of this method (or its namesake that expects to be passed the component that gained the focuse as a parameter) that includes code that will respond appropriately should be defined as part of the program.


focusLost

public void focusLost(java.awt.Component which)
If the program is expected to respond when a some GUI component in the program's interface loses the keyboard focus, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.

Parameters:
which - The component that lost the focus

focusLost

public void focusLost()
If the program is expected to respond when a some GUI component in the program's interface loses the keyboard focus, a version of this method (or its namesake that expects to be passed the component that gained the focuse as a parameter) that includes code that will respond appropriately should be defined as part of the program.


caretRepositioned

public void caretRepositioned(javax.swing.JTextField which)
If the program is expected to respond when the cursor is moved within a JTextField, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.

Parameters:
which - The text field in which the cursor moved

caretRepositioned

public void caretRepositioned(javax.swing.JTextArea which)
If the program is expected to respond when the cursor is moved within a JTextField, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program.

Parameters:
which - The text area in which the cursor moved

caretRepositioned

public void caretRepositioned()
If the program is expected to respond when the cursor is moved within a JTextField or JTextArea, a version of this method (or one of its namesakes that expects a parameter) that includes code to respond appropriately should be defined as part of the program.


windowClosing

public void windowClosing()
If a GUIManager needs to take some action when the user closes its window, a version of this method should be defined that includes the appropriate code.


mousePressed

public void mousePressed(java.awt.Component which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mousePressed

public void mousePressed(javax.swing.JLabel which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mousePressed

public void mousePressed(javax.swing.JPanel which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mousePressed

public void mousePressed(int x,
                         int y)
If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mousePressed

public void mousePressed()
If a GUIManager needs to take some action when the user depresses the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseReleased

public void mouseReleased(java.awt.Component which,
                          int x,
                          int y)
If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseReleased

public void mouseReleased(javax.swing.JLabel which,
                          int x,
                          int y)
If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseReleased

public void mouseReleased(javax.swing.JPanel which,
                          int x,
                          int y)
If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseReleased

public void mouseReleased(int x,
                          int y)
If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseReleased

public void mouseReleased()
If a GUIManager needs to take some action when the user releases the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseClicked

public void mouseClicked(java.awt.Component which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseClicked

public void mouseClicked(javax.swing.JLabel which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseClicked

public void mouseClicked(javax.swing.JPanel which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseClicked

public void mouseClicked(int x,
                         int y)
If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseClicked

public void mouseClicked()
If a GUIManager needs to take some action when the user clicks the mouse button in any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseEntered

public void mouseEntered(java.awt.Component which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseEntered

public void mouseEntered(javax.swing.JLabel which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseEntered

public void mouseEntered(javax.swing.JPanel which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseEntered

public void mouseEntered(int x,
                         int y)
If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseEntered

public void mouseEntered()
If a GUIManager needs to take some action when the user moves the mouse into any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseExited

public void mouseExited(java.awt.Component which,
                        int x,
                        int y)
If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseExited

public void mouseExited(javax.swing.JLabel which,
                        int x,
                        int y)
If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseExited

public void mouseExited(javax.swing.JPanel which,
                        int x,
                        int y)
If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseExited

public void mouseExited(int x,
                        int y)
If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseExited

public void mouseExited()
If a GUIManager needs to take some action when the user moves the mouse out of any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseMoved

public void mouseMoved(java.awt.Component which,
                       int x,
                       int y)
If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseMoved

public void mouseMoved(javax.swing.JLabel which,
                       int x,
                       int y)
If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseMoved

public void mouseMoved(javax.swing.JPanel which,
                       int x,
                       int y)
If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseMoved

public void mouseMoved(int x,
                       int y)
If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseMoved

public void mouseMoved()
If a GUIManager needs to take some action when the user moves the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseDragged

public void mouseDragged(java.awt.Component which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseDragged

public void mouseDragged(javax.swing.JLabel which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseDragged

public void mouseDragged(javax.swing.JPanel which,
                         int x,
                         int y)
If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseDragged

public void mouseDragged(int x,
                         int y)
If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


mouseDragged

public void mouseDragged()
If a GUIManager needs to take some action when the user drags the mouse within any of its components, a version of this method or of one of its variants should be defined that includes the code to the user's action.


connectionEstablished

public void connectionEstablished(TCPPort whichPort)
If the program needs to respond whena new connection to one of its TCPPorts is requested, the a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program. In addition, the addConnectionListener method of the TCPPort should be invoked to inform the TCPPort that the method should be invoked.

Specified by:
connectionEstablished in interface ConnectionListener
Parameters:
whichPort - the TCPPort to which a connection has been established

connectionEstablished

public void connectionEstablished()
If the program needs to respond whena new connection to one of its TCPPorts is requested, the a version of this method (or its parametered namesake) that includes code that will respond appropriately should be defined as part of the program. In addition, the addConnectionListener method of the TCPPort should be invoked to inform the TCPPort that the method should be invoked.


dataAvailable

public void dataAvailable(TCPConnection which)
If the program is expected to respond when new data is received through a TCPConnection, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program. In addition, the addMessageListener method of the TCPConnection should be invoked to inform the TCPConnection that the method should be invoked.

Parameters:
which - the TCPConnection through which data was received

dataAvailable

public void dataAvailable(NetConnection which)
If the program is expected to respond when new data is received through a NetConnection, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program. In addition, the addMessageListener method of the NetConnection should be invoked to inform the NetConnection that the method should be invoked.

Parameters:
which - the NetConnection through which data was received

dataAvailable

public void dataAvailable()
If the program is expected to respond when new data is received through a TCPConnection, a version of this method (or its namesake that expects a parameter) that includes code that will respond appropriately should be defined as part of the program. In addition, the addMessageListener method of the TCPConnection should be invoked to inform the TCPConnection that the method should be invoked.


dataAvailable

public void dataAvailable(java.lang.Object which)
If the program is expected to respond when new data is received through a network connection, a version of this method (or one of its namesakes) that includes code that will respond appropriately should be defined as part of the program. In addition, the addMessageListener method of the connection should be invoked to inform the connection that the method should be invoked.

Specified by:
dataAvailable in interface TCPListener
Parameters:
which - the TCP or Net connection through which data was received

connectionClosed

public void connectionClosed(TCPConnection which)
If the program is expected to respond when a TCPConnection is terminated by the remote system, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program. In addition, the addMessageListener method of the TCPConnection should be invoked to inform the TCPConnection that the method should be invoked.

Parameters:
which - the TCPConnection which has been terminated

connectionClosed

public void connectionClosed(NetConnection which)
If the program is expected to respond when a NetConnection is terminated by the remote system, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program. In addition, the addMessageListener method of the NetConnection should be invoked to inform the NetConnection that the method should be invoked.

Parameters:
which - the NetConnection which has been terminated

connectionClosed

public void connectionClosed()
If the program is expected to respond when a network connection is terminated by the remote system, a version of this method (or one of its namesakes) that includes code that will respond appropriately should be defined as part of the program. In addition, the addMessageListener method of the network connection should be invoked to inform the connection that the method should be invoked.


connectionClosed

public void connectionClosed(java.lang.Object which)
If the program is expected to respond when a NetConnection is terminated by the remote system, a version of this method (or its parameterless namesake) that includes code that will respond appropriately should be defined as part of the program. In addition, the addMessageListener method of the NetConnection should be invoked to inform the NetConnection that the method should be invoked.

Specified by:
connectionClosed in interface TCPListener
Parameters:
which - the NetConnection which has been terminated