java - JavaFX TilePane doesn't wrap the text or showing Ellipsis String -


i using tilepane contains gridpane inside , have created using scenebuilder , fxml.the problem tilepane works strange title saying:

when text big have serious problems layouts cause tilepane isn't wrapping text or showing ellipsis string when resize window layouts failing app.

why happening tilepane , not working expected inside borderpane?


screenshot:

enter image description here


here fxml code:

<?xml version="1.0" encoding="utf-8"?>  <?import javafx.scene.control.contextmenu?> <?import javafx.scene.control.textfield?> <?import javafx.scene.control.titledpane?> <?import javafx.scene.control.tooltip?> <?import javafx.scene.layout.borderpane?> <?import javafx.scene.layout.columnconstraints?> <?import javafx.scene.layout.gridpane?> <?import javafx.scene.layout.rowconstraints?> <?import javafx.scene.layout.stackpane?>  <fx:root styleclass="smartcontroller" type="stackpane" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">    <children>       <borderpane fx:id="mainborder" style="-fx-background-color: transparent; -fx-border-color: red;">          <top>             <titledpane fx:id="titledpane" alignment="center" contentdisplay="center" graphictextgap="0.0" text="i tilepane , don't wrapping text!" wraptext="true" borderpane.alignment="center">                <content>                   <gridpane fx:id="topgrid" gridlinesvisible="true" hgap="5.0" style="-fx-background-color: rgb(0,0,0,0.85);;">                     <columnconstraints>                       <columnconstraints hgrow="sometimes" percentwidth="70.0" />                       <columnconstraints hgrow="sometimes" minwidth="40.0" percentwidth="15.0" />                         <columnconstraints hgrow="sometimes" percentwidth="15.0" />                     </columnconstraints>                     <rowconstraints>                       <rowconstraints minheight="10.0" prefheight="30.0" vgrow="sometimes" />                     </rowconstraints>                      <children>                         <textfield fx:id="pagefield" alignment="center" maxheight="-infinity" maxwidth="65.0" minheight="-infinity" minwidth="-infinity" prefheight="25.0" prefwidth="50.0" gridpane.columnindex="1" gridpane.halignment="center" gridpane.valignment="center">                            <tooltip>                               <tooltip text="current page" />                            </tooltip>                            <contextmenu>                               <contextmenu />                            </contextmenu>                         </textfield>                      </children>                   </gridpane>                </content>             </titledpane>          </top>       </borderpane>    </children> </fx:root> 

by default titledpane has minwidth based on text. it's parent resize node smaller size, have manually assign value:

<titledpane minwidth="0" fx:id="titledpane" alignment="center" contentdisplay="center" graphictextgap="0.0" text="i tilepane , don't wrapping text!" wraptext="true" borderpane.alignment="center">    ... </titledpane> 

this can set in layout section of inspector of titledpane (min width).

as wrapping text:

the title part of titledpane not large enough allow multiple lines default. change using css style sheet:

#titledpane>.title {     -fx-pref-height: 50; /* increase available area */     -fx-alignment: top-center;     -fx-padding: 4 4 4 30; /* increase left padding align text */ }  #titledpane>.title>.arrow-button {     -fx-translate-x: -20; /* move arrow, subject padding */ } 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -