2016-03-13 39 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到了极致。这可能会解决你的问题。

相关问题