resize - JavaFX- scaling the inner elements of a Pane -
when increase window, inner elements stay @ same size.
i want when increase window, elements larger/scale
main.fxml:
<?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <anchorpane cachehint="scale_and_rotate" focustraversable="true" prefheight="600.0" prefwidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.controller"> <children> <tableview fx:id="finaltable" layoutx="27.0" layouty="358.0" maxheight="1.7976931348623157e308" maxwidth="1.7976931348623157e308" prefheight="190.0" prefwidth="766.0" /> <label layoutx="27.0" layouty="21.0" prefheight="25.0" prefwidth="149.0" text=" quell-datei" /> <tableview fx:id="sourcetable" editable="true" layoutx="27.0" layouty="50.0" maxheight="900.0" maxwidth="900.0" minheight="-infinity" minwidth="-infinity" prefheight="190.0" prefwidth="766.0" /> <label layoutx="27.0" layouty="329.0" prefheight="25.0" prefwidth="149.0" text=" konvertierte-datei" /> <button fx:id="linkbtn" layoutx="313.0" layouty="282.0" maxheight="1.7976931348623157e308" maxwidth="1.7976931348623157e308" mnemonicparsing="false" onaction="#linkaction" prefheight="30.0" prefwidth="90.0" text="verbinden" /> <button fx:id="splitbtn" layoutx="437.0" layouty="282.0" maxheight="1.7976931348623157e308" maxwidth="1.7976931348623157e308" mnemonicparsing="false" onaction="#splitaction" prefheight="30.0" prefwidth="90.0" text="trennen" /> </children> </anchorpane>
im working scenebuilder 2.0, , have tried "anchor" button
(see here: http://i.imgur.com/gzyl5xc.png)
...but scaling wrong (see here: http://i.imgur.com/hmmi1p3.png)
i searched whole internet answer, found nothing help.
well layout typically vbox layout. if windows isn't @ fixed size solution, because buttons stay @ same height , in center of window. tableviews grow , shrink resize window. want.
<?xml version="1.0" encoding="utf-8"?> <?import javafx.geometry.*?> <?import java.lang.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <vbox xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.controller"> <children> <label prefheight="25.0" prefwidth="149.0" text=" quell-datei" vbox.vgrow="never" /> <tableview fx:id="sourcetable" editable="true" prefheight="200.0" prefwidth="200.0" vbox.vgrow="always" /> <label /> <hbox alignment="center" prefheight="61.0" prefwidth="766.0" spacing="20.0" vbox.vgrow="never"> <children> <button fx:id="linkbtn" maxheight="-infinity" maxwidth="-infinity" mnemonicparsing="false" onaction="#linkaction" prefheight="30.0" prefwidth="90.0" text="verbinden" hbox.hgrow="never" /> <button fx:id="splitbtn" maxheight="-infinity" maxwidth="-infinity" mnemonicparsing="false" onaction="#splitaction" prefheight="30.0" prefwidth="90.0" text="trennen" hbox.hgrow="never" /> </children> </hbox> <label prefheight="25.0" prefwidth="149.0" text=" konvertierte-datei" vbox.vgrow="never" /> <tableview fx:id="finaltable" prefheight="200.0" prefwidth="200.0" vbox.vgrow="always" /> </children> <padding> <insets bottom="15.0" left="15.0" right="15.0" top="15.0" /> </padding> </vbox>
Comments
Post a Comment