本文整理汇总了Java中javafx.scene.web.WebView.setMaxHeight方法的典型用法代码示例。如果您正苦于以下问题:Java WebView.setMaxHeight方法的具体用法?Java WebView.setMaxHeight怎么用?Java WebView.setMaxHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.web.WebView
的用法示例。
在下文中一共展示了WebView.setMaxHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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());
}
示例2: createScene
import javafx.scene.web.WebView; //导入方法依赖的package包/类
private Scene createScene(String url) {
view = new WebView();
htmlEditor = new HTMLEditor();
view.getEngine().load(url);
final VBox box = new VBox();
view.setMaxHeight(300);
view.setMinHeight(300);
htmlEditor.setMaxHeight(300);
htmlEditor.setMinHeight(300);
box.getChildren().addAll(view, htmlEditor);
final Scene scene = new Scene(box);
scene.setFill(Color.GRAY);
return scene;
}
示例3: createScene
import javafx.scene.web.WebView; //导入方法依赖的package包/类
private Scene createScene(String url) {
view = new WebView();
view2 = new WebView();
web = view.getEngine();
web.load(url);
web.setCreatePopupHandler(new Callback<PopupFeatures, WebEngine>() {
@Override
public WebEngine call(PopupFeatures config) {
return view2.getEngine();
}
});
view2.getEngine().load(MenuLauncher.class.getResource("resources/empty.html").toExternalForm());
final VBox box = new VBox();
view.setMaxHeight(300);
view.setMinHeight(300);
view2.setMaxHeight(300);
view2.setMinHeight(300);
box.getChildren().addAll(view, view2);
final Scene scene = new Scene(box);
scene.setFill(Color.GRAY);
return scene;
}