javafx.scene.web.WebView.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(273)

本文整理了Java中javafx.scene.web.WebView.<init>()方法的一些代码示例,展示了WebView.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.<init>()方法的具体详情如下:
包路径:javafx.scene.web.WebView
类名称:WebView
方法名:<init>

WebView.<init>介绍

暂无

代码示例

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

public Browser() {
  super();
  Platform.runLater(() -> {
   browser = new WebView();
   webEngine = browser.getEngine();
   getChildren().add(browser);
  });
 }
}

代码示例来源:origin: no.tornado/tornadofx-controls

public InlineHTML() {
  getStyleClass().add("inline-html");
  view = new WebView();
  getChildren().add(view);
  content.addListener((observable, oldValue, newValue) ->
    view.getEngine().loadContent(newValue));
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-templatesui

} catch (ClassNotFoundException ignore) {
v = new WebView();
BorderPane bp = new BorderPane();
Scene scene = new Scene(bp, Color.ALICEBLUE);

代码示例来源:origin: com.machinepublishers/jbrowserdriver

WebView view = new WebView();
view.setCache(false);
StackPane root = new StackPane();

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

private void createScene(final String htmlContent) {
  Platform.setImplicitExit(false);
  Platform.runLater(() -> {
      WebView view = new WebView();
      engine = view.getEngine();
      engine.setOnStatusChanged(event -> SwingUtilities.invokeLater(() -> lblStatus.setText(event.getData())));
      engine.getLoadWorker().workDoneProperty()
          .addListener((ChangeListener<Number>) (observableValue, oldValue, newValue) -> SwingUtilities
              .invokeLater(() -> progressBar.setValue(newValue.intValue())));
      engine.getLoadWorker().exceptionProperty()
          .addListener((ObservableValue<? extends Throwable> o,
              Throwable old, final Throwable value) -> {
              if (engine.getLoadWorker().getState() == State.FAILED) {
                SwingUtilities.invokeLater(() -> JOptionPane
                    .showMessageDialog(
                        resultsScrollPane,
                        (value != null) ? engine
                            .getLocation()
                            + "\n"
                            + value.getMessage()
                            : engine.getLocation()
                                + "\nUnexpected error.",
                        "Loading error...",
                        JOptionPane.ERROR_MESSAGE));
              }
          });
      jfxPanel.setScene(new Scene(view));
  });
}

代码示例来源:origin: brunoborges/webfx

public HTMLTab(TabManager tabManager, Locale locale) {
  super(tabManager);
  browser = new WebView();

代码示例来源:origin: org.netbeans.html/net.java.html.boot.fx

@Override
  public WebEngine call(PopupFeatures param) {
    final Stage stage = new Stage(StageStyle.UTILITY);
    stage.initOwner(owner);
    final WebView popUpView = new WebView();
    stage.setScene(new Scene(popUpView));
    Title.observeView(popUpView, stage);
    stage.show();
    return popUpView.getEngine();
  }
});

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

protected void buildCenterArea() {
 HBox firtsRow = new HBox();
 firtsRow.getChildren().addAll(date, NodeHelper.horizontalSpacer());
 centerContainer.getStyleClass().add("notification-view-center-container");
 centerContainer.getChildren().addAll(firtsRow, title, actionsContainer);
 title.getStyleClass().add("notification-title");
 date.getStyleClass().add("notification-date");
 deleteAction.setVisible(true);
 if (notification.getContentType().equals("text/plain")) {
  message.getStyleClass().add("notification-message");
  // centerContainer.getChildren().add(message);
 } else {
  Platform.runLater(() -> {
   WebView browser = new WebView();
   WebEngine webEngine = browser.getEngine();
   webEngine.loadContent(
     "<body style=\"background-color:#757575\">\r\n" + "\r\n" + "<p>\r\n" + "	<span\r\n" + "		style=\"color:white;font-family: 'Open sans', 'Arial', sans-serif; font-size: 10px\">\r\n"
       + "		Le job a &eacute;t&eacute; execut&eacute; avec succ&egrave;s</span>\r\n" + "</p>\r\n" + "</body>\r\n" + "");
   // Add the WebView to the VBox
   // centerContainer.getChildren().add(browser);
  });
 }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxplatform-components

/**
 * {@inheritDoc}
 */
@Override
protected void process() {
 super.process();
 try {
  String location = "www.google.com";
  OperationData data = getStructureContent().formModelDataProperty().get();
  javafx.application.Platform.runLater(()->{
   WebView webView = new WebView();
   webView.getEngine().load(location);
   layout.getChildren().add(webView);
  });
 }catch (Exception e) {
  e.printStackTrace();
  unsupported();
 }
 processedView(layout);
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxplatform-components

/**
 * {@inheritDoc}
 */
@Override
protected void process() {
 super.process();
 try {
  String location = null;
  OperationData data = getStructureContent().formModelDataProperty().get();
  if(location != null) {
   javafx.application.Platform.runLater(()->{
    WebView webView = new WebView();
    webView.getEngine().load(location);
    layout.getChildren().add(webView);
   });
  }
 }catch (Exception e) {
  e.printStackTrace();
  unsupported();
 }
 processedView(layout);
}

代码示例来源:origin: PhoenicisOrg/phoenicis

@Override
protected void drawStepContent() {
  final String title = this.getParentWizardTitle();
  VBox contentPane = new VBox();
  contentPane.setId("presentationBackground");
  Label titleWidget = new Label(title + "\n\n");
  titleWidget.setId("presentationTextTitle");
  WebView webView = new WebView();
  VBox.setVgrow(webView, Priority.ALWAYS);
  webView.getEngine().loadContent(htmlToShow);
  final URL style = getClass().getResource(String.format("/org/phoenicis/javafx/themes/%s/description.css",
      getParent().getThemeManager().getCurrentTheme().getShortName()));
  webView.getEngine().setUserStyleSheetLocation(style.toString());
  contentPane.getChildren().addAll(webView);
  getParent().getRoot().setCenter(contentPane);
}

代码示例来源:origin: cpesch/RouteConverter

protected WebView createWebView() {
  try {
    final WebView webView = new WebView();
    double browserScaleFactor = getBrowserScaleFactor();
    if (browserScaleFactor != 1.0)

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-demoapp

Runnable initWebView = () -> {
 try {
  WebView browser = new WebView();
  webEngine = browser.getEngine();

代码示例来源:origin: org.apidesign.html/boot-fx

private WebView newView(final URL url, final FXPresenter onLoad) {
  final WebView view = new WebView();
  view.setContextMenuEnabled(false);
  view.getEngine().setOnAlert(new EventHandler<WebEvent<String>>() {

代码示例来源:origin: org.controlsfx/controlsfx

final Callback<ImageView, Void> callback, 
              final WritableImage outputImage) {
final WebView view = new WebView();
final WebEngine eng = view.getEngine();

代码示例来源:origin: PhoenicisOrg/phoenicis

/**
 * {@inheritDoc}
 */
@Override
protected Node createContent() {
  final WebView appDescription = new WebView();
  appDescription.getEngine().userStyleSheetLocationProperty().bind(getControl().webEngineStylesheetProperty());
  VBox.setVgrow(appDescription, Priority.ALWAYS);
  getControl().applicationProperty().addListener((Observable invalidation) -> updateDescription(appDescription));
  updateDescription(appDescription);
  final Label installers = new Label(tr("Installers"));
  installers.getStyleClass().add("descriptionTitle");
  final GridPane scriptGrid = new GridPane();
  filteredScripts.addListener((InvalidationListener) change -> updateScripts(scriptGrid));
  getControl().showScriptSourceProperty().addListener((Observable invalidation) -> updateScripts(scriptGrid));
  updateScripts(scriptGrid);
  final HBox miniaturesPane = new HBox();
  miniaturesPane.getStyleClass().add("appPanelMiniaturesPane");
  Bindings.bindContent(miniaturesPane.getChildren(), miniatures);
  final ScrollPane miniaturesPaneWrapper = new ScrollPane(miniaturesPane);
  miniaturesPaneWrapper.getStyleClass().add("appPanelMiniaturesPaneWrapper");
  miniatureHeight.bind(miniaturesPaneWrapper.heightProperty().multiply(0.8));
  return new VBox(appDescription, installers, scriptGrid, miniaturesPaneWrapper);
}

代码示例来源:origin: org.netbeans.html/net.java.html.boot.fx

private WebView newView(final URL url, final AbstractFXPresenter onLoad) {
  final WebView view = new WebView();
  view.setContextMenuEnabled(false);
  Stage newStage;

代码示例来源:origin: org.netbeans.html/net.java.html.boot.fx

final Stage stage = new Stage(StageStyle.UTILITY);
stage.initOwner(owner);
final WebView popUpView = new WebView();
stage.setScene(new Scene(popUpView));
Title.observeView(popUpView, stage);

相关文章