public final class Client extends Applet
Applet.AccessibleAppletPanel.AccessibleAWTPanelContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
Client()
The default constructor does nothing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
This method is called from the AppleContext, when the applet is being
disposed.
|
static Frame |
frame(Component component,
String title)
This method is used by items to create a frame containing the AWT
or Swing component.
|
String |
getAppletInfo()
This method provides the standard mechanism to identify this applet.
|
String[][] |
getParameterInfo()
When running as an applet, this method describes the optional client
parameters.
|
void |
init()
When running as an applet, this method will connect back to its hosting
server and request the item from the server's rmiregistry.
|
static void |
main(String[] args)
The application creates a graphical proxy hosting VM.
|
void |
start()
This method is called from the AppleContext, each time the applet
becomes visible.
|
void |
stop()
This method is called from the AppleContext, each time the applet
becomes invisible.
|
void |
update(Graphics g)
The update method double buffers the applet's paint method, to reduce
flicker from the default background repainting.
|
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatusadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validate, validateTreeaction, 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, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, 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, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic Client()
public String getAppletInfo()
getAppletInfo in class Appletpublic String[][] getParameterInfo()
proxyName parameter is the name of the proxy server
item registered in the server's rmiregistry. Unspecified it will be
"main".
proxyPort parameter is the outbound port number on
which to contact the proxy server. Unspecified it will be 1099. If the
client is operating behind a firewall, the must be a permitted outbound
port.
clientHost parameter is the external domain name or
IP address the server must use to callback its proxy. It may need to
be specified if the client is operating behind a NAT router. Unspecified
it will be the client's default host address.
clientPort parameter is the external inbound port
number on which the server can contact its proxy. It may need to be
specified if the client is behind NAT, to map to the correct local port.
If a firewall is being used, it must be a permitted inbound port.
Unspecified, it will be the same as the local port value below.
localPort parameter is the internal inbound port
number on which the server can contact its proxy. It may need to be
specified if the client is behind NAT, to map to the correct remote port.
Unspecified, it will be anonymous.
getParameterInfo in class Appletpublic void init()
public void start()
public void stop()
public void destroy()
public void update(Graphics g)
public static Frame frame(Component component, String title)
component - The AWT/Swing component, typically returned from a
proxy initialization, to be framed.public static void main(String[] args) throws Exception
getItem
method of the Remote class to contact the server. It will
then invoke a null-argument getProxy on the resulting reference to
request the primary proxy object of the item. If the proxy is a Swing
JComponent, it will be displayed in a JFrame. If it is an AWT Component,
it will be displayed in a Frame.ExceptionCopyright © 2016. All Rights Reserved.