2016-03-13 36 views
0

我是新來的JavaFX tabpane,剛開始練習。 我在UI上工作,我很難理解。如何調整內部VBOX

  • 我在0 索引截取的splitpane在其內部具有兩個錨窗格一個和另一個是在拆分窗格1名的索引。如圖所示 得到更好的主意。

    Splitpane 
        | - > Anchorpane 
        | - > Anchorpane 
          | - > Hbox 
          | - > Tabpane 
          | - > Hbox 
    

    enter image description here在分離指標1區 現在,

  • 我只想當用戶chages的devider位置 和調整tabpane剩餘Hboxs會留下,因爲它是

  • 我試過tabpane最大高度設置,vgrow =總是和許多 東西,但沒有工作。有沒有辦法,我只能綁定tabpane 母公司和成長時父母成長什麼辦法?
+0

它的極端很難理解你試圖實現從description.I勸你描述它更多產品詳情和有點不同的方式,順便說一句我的建議是,使用場景生成器是什麼,它的完美 - 膠子是提供公司它支持現在,您可以在這裏http://gluonhq.com/open-source/scene-builder/我敢肯定得到它,當你得到你的手放在它,你可以創造任何其易於使用,你看到它在飛行,使用fxml –

+0

請[編輯]你的問題,包括代碼。你爲什麼使用AnchorPane的原因? –

回答

0

編輯:我使用錯誤的tableView而不是TabPane,芽結果是一樣的無論哪種方式,

所以我想我知道你想做什麼,我打開sceneBuilder這裏是結果:

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

<?import java.lang.*?> 
<?import javafx.scene.control.*?> 
<?import javafx.scene.layout.*?> 


<SplitPane dividerPositions="0.5" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" orientation="VERTICAL" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1"> 
    <items> 
     <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0" /> 
     <BorderPane prefHeight="200.0" prefWidth="200.0"> 
     <top> 
      <HBox prefHeight="53.0" prefWidth="598.0" style="-fx-background-color: red;" BorderPane.alignment="CENTER" /> 
     </top> 
     <center> 
      <TableView prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER"> 
       <columns> 
        <TableColumn prefWidth="75.0" text="C1" /> 
        <TableColumn prefWidth="75.0" text="C2" /> 
       </columns> 
      </TableView> 
     </center> 
     <bottom> 
      <HBox prefHeight="34.0" prefWidth="598.0" style="-fx-background-color: yellow;" BorderPane.alignment="CENTER" /> 
     </bottom> 
     </BorderPane> 
    </items> 
</SplitPane> 

結果:

enter image description here

enter image description here

這就是你正在嘗試做的?在拆分窗格上的索引是空的,用borderpane那裏和另一個內容添加到您的鏈接

-1

設置你的孩子setPrefSize到了極致。這可能會解決你的問題。

相關問題