Eclipse 4.4ではじめる Javaプログラミング入門 Eclipse 4.4 Luna対応

JavaFXによるGUIプログラミング - コントロールを活用する

Icon comment count 0
Icon stock count 0

3.2.12TilePaneの利用

FlowPaneと同様に、コントロール類を一列に並べて配置するものにTilePaneというペインもあります。基本的な使い方は、FlowPaneとほとんど変わりありません。では、何が違うのか? それは、コントロールの並べ方です。これは実際にやってみるとわかるでしょう。

リスト3.14 window.fxml(書き換える部分)
<TilePane prefHeight="150.0" prefWidth="300.0" 
  xmlns="http://javafx.com/javafx/8" 
  xmlns:fx="http://javafx.com/fxml/1" 
  fx:controller="jp.tuyano.eclipsebook.WindowController">
  <Button text="Button1" />
  <Button text="Button__2" />
  <Button text="Button____3" />
  <Button text="Button______4" />
  <Button text="Button________5" />
</TilePane>
図3.33TilePaneは、それぞれのコントロールを等間隔

コメント

    コメントはありません