2014-07-17 2 views
0

SplitPane - 가로 모두에 SplitPane이 있습니다. 절대 너비/높이를 지정하지 않으려합니다. 내가 너비/높이를 지정하지 않으면, 두 번째 SplitPane가 표시되지 않습니다 :JavaFX : 절대 너비를 지정하지 마십시오

<?xml version="1.0" encoding="UTF-8"?> 

<?import javafx.scene.control.*?> 
<?import javafx.scene.Group?> 
<?import javafx.scene.layout.*?> 
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="500.0" style="-fx-background-color: cornsilk;" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> 
    <left> 
     <ToolBar orientation="VERTICAL"> 
      <items> 
       <Group> 
        <children> 
         <Button rotate="-90.0" text="Project" /> 
        </children> 
       </Group> 
       <Group> 
        <children> 
         <Button rotate="-90.0" text="Structure" /> 
        </children> 
       </Group> 
      </items> 
     </ToolBar> 
    </left> 
    <center> 
     <SplitPane dividerPositions="0.25" style="-fx-background-color:red;"> 
     <items> 
      <AnchorPane style="-fx-background-color:darkblue;"/> 
      <AnchorPane style="-fx-background-color:gold;"> 
       <children> 
        <SplitPane dividerPositions="0.25"> 
         <items> 
          <AnchorPane style="-fx-background-color:khaki;"/> 
          <AnchorPane style="-fx-background-color:lime;"/> 
         </items> 
        </SplitPane> 
       </children> 
      </AnchorPane> 
     </items> 
     </SplitPane> 
    </center> 
</BorderPane> 
+0

당신이없는 경우 splitpane에 너비를 지정하고 싶다면, 자식의 너비 인'AnchorPane'을 atleast로 지정해야합니다. – ItachiUchiha

+0

따라서 부모와 같이 넓은 범위 (100 %)를 만들 수 없습니까? – user3111525

답변

0

문제를 SplitPane<SplitPane dividerPositions="0.25" AnchorPane.topAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">와 수정을 정의, 여기에 MWE입니다 :

<?xml version="1.0" encoding="UTF-8"?> 

<?import javafx.scene.control.*?> 
<?import javafx.scene.Group?> 
<?import javafx.scene.layout.*?> 
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="700.0" style="-fx-background-color: cornsilk;" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> 
    <left> 
     <ToolBar orientation="VERTICAL"> 
      <items> 
       <Group> 
        <children> 
         <Button rotate="-90.0" text="Project" /> 
        </children> 
       </Group> 
       <Group> 
        <children> 
         <Button rotate="-90.0" text="Structure" /> 
        </children> 
       </Group> 
      </items> 
     </ToolBar> 
    </left> 
    <center> 
     <SplitPane dividerPositions="0.25" style="-fx-background-color:red;"> 
     <items> 
      <AnchorPane style="-fx-background-color:green;"/> 
      <AnchorPane style="-fx-background-color:blue;"> 
       <children> 
        <SplitPane dividerPositions="0.25" AnchorPane.topAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"> 
         <items> 
          <AnchorPane style="-fx-background-color:black;"/> 
          <AnchorPane style="-fx-background-color:aqua;"/> 
         </items> 
        </SplitPane> 
       </children> 
      </AnchorPane> 
     </items> 
     </SplitPane> 
    </center> 
</BorderPane> 
관련 문제