#JavaFX WebView does not resize automatically inside a TabPane.
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
my fxml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.web.WebView?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="520.0" prefWidth="850.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.smallplayz.javawebbrowser.Test2">
<center>
<TabPane fx:id="tabPane" prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE" BorderPane.alignment="CENTER">
<tabs>
<Tab text="Google">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="522.0" prefWidth="858.0">
<children>
<VBox prefHeight="493.0" prefWidth="799.0">
<children>
<WebView fx:id="webView" prefHeight="491.0" prefWidth="799.0" />
</children>
</VBox>
</children></AnchorPane>
</content>
</Tab>
</tabs>
</TabPane>
</center>
<left>
<VBox prefHeight="400.0" prefWidth="50.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="newTabButton" alignment="CENTER" mnemonicParsing="false" onAction="#newTab" text="+">
<VBox.margin>
<Insets left="10.0" top="10.0" />
</VBox.margin>
</Button>
</children>
</VBox>
</left>
</BorderPane>
Detected code, here are some useful tools:
< ? xml version = "1.0"encoding = "UTF-8" ? > < ? import javafx.geometry.Insets ? > < ? import javafx.scene.control.Button ? > < ? import javafx.scene.control.Tab ? > < ? import javafx.scene.control.TabPane ? > < ? import javafx.scene.layout.AnchorPane ? > < ? import javafx.scene.layout.BorderPane ? > < ? import javafx.scene.layout.VBox ? > < ? import javafx.scene.web.WebView ? > < BorderPane maxHeight = "-Infinity"maxWidth = "-Infinity"minHeight = "-Infinity"minWidth = "-Infinity"prefHeight = "520.0"prefWidth = "850.0"xmlns = "http://javafx.com/javafx/19"xmlns : fx = "http://javafx.com/fxml/1"fx : controller = "com.smallplayz.javawebbrowser.Test2" > <center> < TabPane fx : id = "tabPane"prefHeight = "200.0"prefWidth = "200.0"tabClosingPolicy = "UNAVAILABLE"BorderPane.alignment = "CENTER" > <tabs> < Tab text = "Google" > <content> < AnchorPane minHeight = "0.0"minWidth = "0.0"prefHeight = "522.0"prefWidth = "858.0" > <children> < VBox prefHeight = "493.0"prefWidth = "799.0" > <children> < WebView fx : id = "webView"prefHeight = "491.0"prefWidth = "799.0" / > < / children > < / VBox > < / children > < / AnchorPane > < / content > < / Tab > < / tabs > < / TabPane > < / center > <left> < VBox prefHeight = "400.0"prefWidth = "50.0"BorderPane.alignment = "CENTER" > <children> < Button fx : id = "newTabButton"alignment = "CENTER"mnemonicParsing = "false"onAction = "#newTab"text = "+" > <VBox.margin> < Insets left = "10.0"top = "10.0" / > < / VBox.margin > < / Button > < / children > < / VBox > < / left > < / BorderPane >
ping me if you want to help
alright guys this might seem sily but i just fixxed it
idk how to close thos
its explained by the bot in the beginning 🙂