当前位置: 首页>>代码示例>>Java>>正文


Java WebView.setId方法代码示例

本文整理汇总了Java中javafx.scene.web.WebView.setId方法的典型用法代码示例。如果您正苦于以下问题:Java WebView.setId方法的具体用法?Java WebView.setId怎么用?Java WebView.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.web.WebView的用法示例。


在下文中一共展示了WebView.setId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    WebEngine e = view.getEngine();
    e.loadContent("<div style='height: 50px; background-color: limegreen;'>Narrow div</div>");
    view.setMinHeight(MIN_HEIGHT);
    view.setId(VIEW_ID);

    VBox box = new VBox();
    box.setMaxHeight(MIN_HEIGHT - 10);
    box.setMinHeight(MIN_HEIGHT - 10);
    box.setPrefHeight(MIN_HEIGHT - 10);
    box.getChildren().add(view);

    final Scene scene = new Scene(box);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println(view.getHeight());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:22,代码来源:MinHeightTestApp.java

示例2: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    view.setPrefHeight(PREF_HEIGHT);
    view.setId(VIEW_ID);

    VBox box = new VBox();
    box.getChildren().add(view);

    final Scene scene = new Scene(box);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println(view.getHeight());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:17,代码来源:PrefHeightTestApp.java

示例3: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    WebEngine e = view.getEngine();
    e.loadContent("<div style='width: 50px; background-color: limegreen;'>Narrow div</div>");
    view.setMinWidth(MIN_WIDTH);
    view.setId(VIEW_ID);

    HBox box = new HBox();
    box.setMaxWidth(MIN_WIDTH - 10);
    box.setMinWidth(MIN_WIDTH - 10);
    box.setPrefWidth(MIN_WIDTH - 10);
    box.getChildren().add(view);

    final Scene scene = new Scene(box);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println(view.getWidth());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:22,代码来源:MinWidthTestApp.java

示例4: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    WebEngine e = view.getEngine();
    e.loadContent("<div style='height: 1024px; width: 1024; background-color: limegreen;'>Big div</div>");
    view.setMaxSize(MAX_WIDTH, MAX_HEIGHT);
    view.setId(VIEW_ID);

    HBox box = new HBox();
    box.getChildren().add(view);

    final Scene scene = new Scene(box);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println("Width:" + view.getWidth());
    System.out.println("Height:" + view.getHeight());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:20,代码来源:MaxSizeTestApp.java

示例5: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    WebEngine e = view.getEngine();
    e.loadContent("<div style='height: 30px; width: 30; background-color: limegreen;'>Small div</div>");
    view.setMinSize(MIN_WIDTH, MIN_HEIGHT);
    view.setId(VIEW_ID);

    VBox box = new VBox();
    box.setMaxWidth(MIN_WIDTH - 10);
    box.setPrefWidth(MIN_WIDTH - 10);
    box.setMinWidth(MIN_WIDTH - 10);
    box.setMaxHeight(MIN_HEIGHT - 10);
    box.setPrefHeight(MIN_HEIGHT - 10);
    box.setMinHeight(MIN_HEIGHT - 10);

    box.getChildren().add(view);

    final Scene scene = new Scene(box);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println("Width:" + view.getWidth());
    System.out.println("Height:" + view.getHeight());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:27,代码来源:MinSizeTestApp.java

示例6: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    WebEngine e = view.getEngine();
    e.loadContent("<div style='width: 1024px; background-color: limegreen;'>Wide div</div>");
    view.setMaxWidth(MAX_WIDTH);
    view.setId(VIEW_ID);

    VBox box = new VBox();
    box.getChildren().add(view);

    final Scene scene = new Scene(box);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println(view.getWidth());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:MaxWidthTestApp.java

示例7: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    view.setPrefSize(PREF_WIDTH, PREF_HEIGHT);
    view.setId(VIEW_ID);

    FlowPane pane = new FlowPane();
    pane.getChildren().add(view);

    final Scene scene = new Scene(pane);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println("Width:" + view.getWidth());
    System.out.println("Height:" + view.getHeight());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:18,代码来源:PrefSizeTestApp.java

示例8: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    WebEngine e = view.getEngine();
    e.loadContent("<div style='height: 1024px; background-color: limegreen;'>Tall div</div>");
    view.setMaxHeight(MAX_HEIGHT);
    view.setId(VIEW_ID);

    HBox box = new HBox();
    box.getChildren().add(view);

    final Scene scene = new Scene(box);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println(view.getHeight());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:19,代码来源:MaxHeightTestApp.java

示例9: start

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public void start(Stage stage){
    WebView view = new WebView();
    view.setPrefWidth(PREF_WIDTH);
    view.setId(VIEW_ID);

    HBox box = new HBox();
    box.getChildren().add(view);

    final Scene scene = new Scene(box);
    stage.setTitle(VIEW_ID);
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();

    System.out.println(view.getWidth());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:17,代码来源:PrefWidthTestApp.java


注:本文中的javafx.scene.web.WebView.setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。