public class HtmlBrowser
extends javax.swing.JPanel
If all you want to do is to show some URL, this
is overkill. Just use HtmlBrowser.URLDisplayer.showURL(java.net.URL) instead. Using HtmlBrowser
is appropriate mainly if you want to embed a web browser in some other GUI component
(if the user has selected an external browser, this will fall back to a simple Swing
renderer). Similarly Impl (coming from a Factory) is the lower-level
renderer itself (sans toolbar).
Summary: for client use, try URLDisplayer.showURL, or for more control
or where embedding is needed, create an HtmlBrowser. For provider use,
create a Factory and register an instance of it to lookup.
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
HtmlBrowser.Factory |
Implementation of BrowerFactory creates new instances of some Browser implementation.
|
static class |
HtmlBrowser.Impl |
This interface represents an implementation of html browser used in HtmlBrowser.
|
static class |
HtmlBrowser.URLDisplayer |
A manager class which can display URLs in the proper way.
|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategyjava.awt.Container.AccessibleAWTContainer| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_HEIGHT |
Preferred height of the browser
|
static int |
DEFAULT_WIDTH |
Preferred width of the browser
|
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor | Description |
|---|---|
HtmlBrowser() |
Creates new html browser with toolbar and status line.
|
HtmlBrowser(boolean toolbar,
boolean statusLine) |
Creates new html browser.
|
HtmlBrowser(HtmlBrowser.Factory fact,
boolean toolbar,
boolean statusLine) |
Creates new html browser.
|
HtmlBrowser(HtmlBrowser.Factory fact,
boolean toolbar,
boolean statusLine,
java.awt.Component extraToolbar) |
Creates new html browser.
|
| Modifier and Type | Method | Description |
|---|---|---|
javax.accessibility.AccessibleContext |
getAccessibleContext() |
|
java.awt.Component |
getBrowserComponent() |
Get the browser component.
|
HtmlBrowser.Impl |
getBrowserImpl() |
Get the browser implementation.
|
java.net.URL |
getDocumentURL() |
Gets current document url.
|
static java.lang.String |
getHomePage() |
Getter for the home page
|
java.awt.Dimension |
getPreferredSize() |
Returns preferred size.
|
boolean |
isStatusLineVisible() |
Gets status line state.
|
boolean |
isToolbarVisible() |
Gets status toolbar.
|
void |
requestFocus() |
|
boolean |
requestFocusInWindow() |
|
void |
setEnableHome(boolean b) |
Enables/disables Home button.
|
void |
setEnableLocation(boolean b) |
Enables/disables location.
|
static void |
setFactory(HtmlBrowser.Factory brFactory) |
Deprecated.
Use Lookup instead to register factories
|
static void |
setHomePage(java.lang.String u) |
Sets the home page.
|
void |
setStatusLineVisible(boolean v) |
Shows/hides status line.
|
void |
setToolbarVisible(boolean v) |
Shows/hides toolbar.
|
void |
setURL(java.lang.String str) |
Sets new URL.
|
void |
setURL(java.net.URL url) |
Sets new URL.
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleadd, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updatepublic static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public HtmlBrowser()
public HtmlBrowser(boolean toolbar,
boolean statusLine)
toolbar - visibility of toolbarstatusLine - visibility of statusLinepublic HtmlBrowser(HtmlBrowser.Factory fact, boolean toolbar, boolean statusLine)
fact - Factory that is used for creation. If null is passed it searches for
a factory providing displayable component.toolbar - visibility of toolbarstatusLine - visibility of statusLinepublic HtmlBrowser(HtmlBrowser.Factory fact, boolean toolbar, boolean statusLine, java.awt.Component extraToolbar)
fact - Factory that is used for creation. If null is passed it searches for
a factory providing displayable component.toolbar - visibility of toolbarstatusLine - visibility of statusLineextraToolbar - Additional toolbar to be displayed under the default
toolbar with location field and back/forward buttons.public static void setHomePage(java.lang.String u)
u - the home pagepublic static java.lang.String getHomePage()
@Deprecated public static void setFactory(HtmlBrowser.Factory brFactory)
public void setURL(java.lang.String str)
str - URL to show in this browser.public void setURL(java.net.URL url)
url - URL to show in this browser.public final java.net.URL getDocumentURL()
public final void setEnableHome(boolean b)
b - public final void setEnableLocation(boolean b)
b - public boolean isStatusLineVisible()
public void setStatusLineVisible(boolean v)
v - public boolean isToolbarVisible()
public void setToolbarVisible(boolean v)
v - public final HtmlBrowser.Impl getBrowserImpl()
public final java.awt.Component getBrowserComponent()
public java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic void requestFocus()
requestFocus in class javax.swing.JComponentpublic boolean requestFocusInWindow()
requestFocusInWindow in class javax.swing.JComponentpublic javax.accessibility.AccessibleContext getAccessibleContext()
getAccessibleContext in class javax.swing.JPanelBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.