本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}