#JavaFX WebView does not resize automatically inside a TabPane.

1 messages · Page 1 of 1 (latest)

old wharfBOT
#

<@&987246487241105418> please have a look, thanks.

old wharfBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

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.

open girder
#

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>
old wharfBOT
# open girder my fxml file looks like this: ```html <?xml version="1.0" encoding="UTF-8"?> <?...

Detected code, here are some useful tools:

Formatted code
 <  ? 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 >
open girder
#

ping me if you want to help

#

alright guys this might seem sily but i just fixxed it

#

idk how to close thos

clear grove