|
JDIC API V0.8 Release 4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Canvas
org.jdesktop.jdic.browser.WebBrowser
A WebBrowser
component represents a blank rectangular area of the
screen onto which the application can display webpages or from which the
application can trap events from the browser window. In order to show WebBrowser
component in GUI, user need to add WebBrowser to a top-level container, such as
Frame
.
The class that is interested in processing a WebBrowser event should implement
interface WebBrowserListener
, and the object created with that class
should use WebBrowser's addWebBrowserListener
method to register
as a listener.
The WebBrowser
class has an inner class Status
. User can use
getStatus
method to retrieve the Status
object of the
WebBrowser object. Querying status of this WebBrowser can be done by calling methods
provided by the Status
class.
WebBrowserEvent
,
WebBrowserListener
,
Serialized FormNested Class Summary | |
---|---|
static class |
WebBrowser.Status
An inner class which is used for retrieving the WebBrowser's properties, such as the initialization status, back and forward status. |
Nested classes/interfaces inherited from class java.awt.Canvas |
---|
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
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 | |
---|---|
WebBrowser()
Constructs a new WebBrowser object with no URL specified. |
|
WebBrowser(java.net.URL url)
Constructs a new WebBrowser with an URL specified. |
Method Summary | |
---|---|
void |
addNotify()
Overrides the same method of java.awt.Canvas in order to
paint the browser window. |
void |
addWebBrowserListener(WebBrowserListener listener)
Adds a WebBrowserEvent listener. |
void |
back()
Navigates to the previous session history item. |
void |
forward()
Navigates to the next session history item. |
WebBrowser.Status |
getStatus()
Returns a Status object, which indicates the status of this
WebBrowser object. |
java.net.URL |
getURL()
Retrieves the URL that is currently being displayed. |
void |
paint(java.awt.Graphics g)
Overrides the same method of java.awt.Canvas in order to
paint the browser window. |
void |
refresh()
Reloads the URL that is currently being displayed in the WebBrowser component. |
void |
removeWebBrowserListener(WebBrowserListener listener)
Removes a WebBrowserEvent listener. |
void |
setBounds(int x,
int y,
int w,
int h)
Moves and resizes this component. |
static void |
setDebug(boolean b)
Sets trace messages on or off. |
void |
setURL()
Sets the document to be a blank page. |
void |
setURL(java.net.URL url)
Navigates to a resource identified by an URL using HTTP GET method. |
void |
setURL(java.net.URL url,
java.lang.String postData)
Navigates to a resource identified by an URL using HTTP POST method. |
void |
stop()
Stops loading of the current URL. |
protected boolean |
willOpenURL(java.net.URL url)
Called before every navigation operation occurs. |
protected boolean |
willOpenWindow()
Called before every new window is to be created. |
Methods inherited from class java.awt.Canvas |
---|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WebBrowser()
WebBrowser
object with no URL specified.
public WebBrowser(java.net.URL url)
WebBrowser
with an URL specified.
Method Detail |
---|
public void addNotify()
java.awt.Canvas
in order to
paint the browser window. On Windows system it is invoked by the system
automatically, users are not recommended to call it.
addNotify
in class java.awt.Canvas
public void setBounds(int x, int y, int w, int h)
setBounds
in class java.awt.Component
x
- - the new x-coordinate of this componenty
- - the new y-coordinate of this componentw
- - the new width of this componenth
- - the new height of this componentpublic void addWebBrowserListener(WebBrowserListener listener)
WebBrowserEvent
listener.
listener
- object which implements WebBrowserListener interface.public void removeWebBrowserListener(WebBrowserListener listener)
WebBrowserEvent
listener.
listener
- object which implements WebBrowserListener interface.
If the listener was not in the listeners list, then no listener will be
removed.public java.net.URL getURL()
null
if the WebBrowser object
is not ready with initialization of itself.public void setURL()
public void setURL(java.net.URL url)
url
- the URL to navigate.public void setURL(java.net.URL url, java.lang.String postData)
url
- the URL to navigate.postData
- Data to send to the server during the HTTP POST transaction.public void back()
public void forward()
public void refresh()
public void stop()
public static void setDebug(boolean b)
b
- true
if enable the trace messages; otherwise,
false
.public WebBrowser.Status getStatus()
Status
object, which indicates the status of this
WebBrowser
object.
WebBrowser.Status
protected boolean willOpenURL(java.net.URL url)
false
will prevent the the navigation from starting;
otherwise true
.protected boolean willOpenWindow()
false
will prevent the new window from popping up; otherwise
true
.public void paint(java.awt.Graphics g)
java.awt.Canvas
in order to
paint the browser window. On Linux and Unix systems it is invoked by
the system automatically, users are not recommended to call it.
paint
in class java.awt.Canvas
g
- the specified graphics context.
|
JDIC API V0.8 Release 4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, working code examples, license terms and bug report information.
Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.