java - How to change JavaFX TabPane pane type -
i want make webview inside anchorpane controlled tabpane:
here's tabpane hierarchy in this:
i don't know how make webview fill entire area, , responsive @ same time. can change preferred size, don't know how make 100% fill pane. i'm brand new javafx, , using scene builder (i came swing). thank you!
a tab size content node fill available space in tab (up max size). long leave max width , max height of web view defaults (double.max_value
), can place web view directly in tab without using anchor pane, , sized full size of tab.
here simple example:
<?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.web.*?> <?import java.lang.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.control.tabpane?> <tabpane xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1"> <tabs> <tab text="untitled tab"> <content> <webview fx:id="webview" prefheight="200.0" prefwidth="200.0" /> </content> </tab> </tabs> </tabpane>
here document hierarchy in scene builder: