webview 不会在 javafx 中最大化屏幕

我正在使用scenebuilder,我希望我的应用程序具有横向工具栏和网络视图。我遇到的问题是当我最大化屏幕时,webview 保持相同的大小,而窗格变大。我尝试过 Stackpane,但没有用。现在的结构看起来像这样:


Pane

   VBox

   StackPane

      WebView

编辑:我尝试了其他的东西,例如这让我调整大小但堆栈面板填满了整个屏幕,没有地方放置 vBox


AnchorPane

   VBox

   StackPane

      WebView

我的 fxml


<AnchorPane fx:id="anchor" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.BrowserController">

   <children>

      <VBox fx:id="vbox" prefHeight="600.0" prefWidth="200.0" style="-fx-background-color: red;" />

<StackPane fx:id="subPane" alignment="CENTER_RIGHT" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">

         <children>

            <WebView fx:id="webview" prefWidth="600.0" />

         </children>

      </StackPane>

   </children>

</AnchorPane>


德玛西亚99
浏览 368回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java