public enum BrowserType extends java.lang.Enum<BrowserType>
| Enum Constant and Description |
|---|
HEAVYWEIGHT
Indicates that
Browser instance will be initialized as a heavyweight component.
|
LIGHTWEIGHT
Indicates that
Browser instance will be initialized as a lightweight (off-screen) component.
|
| Modifier and Type | Method and Description |
|---|---|
static BrowserType |
getDefault()
Returns
返回通过“ jxbrowser.browser.type”系统属性提供的BrowserType。 BrowserType provided via the "jxbrowser.browser.type" System Property.
|
static BrowserType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
返回具有指定名称的此类型的枚举常量。 |
static BrowserType[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared.
以声明顺序返回包含此枚举类型的常量的数组。 |
public static final BrowserType LIGHTWEIGHT
Browser instance will be initialized as a lightweight (off-screen) component. In this mode Chromium engine renders web page content off-screen and Java component just displays rendering results as image using standard Java Graphics API.
In this mode GPU acceleration in Chromium engine isn't used. As result, rendering performance isn't so good as with enabled GPU acceleration.
It's recommended to configure
Browser instance with this type in Java Swing/JavaFX applications where lightweight is the main requirements. For example, when transparent JPanel should be displayed over
BrowserView component, or when
BrowserView component is embedded into
JInternalFrame or layered panels.
public static final BrowserType HEAVYWEIGHT
Browser instance will be initialized as a heavyweight component. Heavyweight components represents a native window embedded into Java frame.
In this mode Chromium uses GPU acceleration to render web page content directly onto an embedded into Java frame window. Rendering performance in this case is the same as in Google Chrome.
It's recommended to configure
Browser instance with this type in Java applications where rendering performance is very critical (e.g. displaying video or WebGL content). Since
BrowserView represents a native heavyweight window embedded into Java application's frame, it's not recommended to display lightweight Swing/JavaFX components over heavyweight
BrowserView component. The heavyweight
BrowserView component will be always displayed over lightweight Swing/JavaFX components.
public static BrowserType[] values()
for (BrowserType c : BrowserType.values()) System.out.println(c);
public static BrowserType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
-要返回的枚举常量的名称。
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null
public static BrowserType getDefault()
BrowserType provided via the "jxbrowser.browser.type" System Property. If the System Property isn't specified, this method returns
HEAVYWEIGHT value.
To configure default
BrowserType use the following System Property values:
jxbrowser.browser.type=LIGHTWEIGHT or
jxbrowser.browser.type=HEAVYWEIGHT.
BrowserType value.
默认值。