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

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

Icon comment count 0
Icon stock count 0

3.2.15StackPaneについて

これまでのペインは、基本的に組み込まれたコントロール類を一度に全て表示するようになっていました。が、そうでないペインもあります。StackPaneは、組み込まれたコントロールをスタック(積み重ね)してまとめ、一番最後に追加したものだけを表示します。

リスト3.18 window.fxml(書き換える部分)
<StackPane prefHeight="150.0" prefWidth="300.0" fx:id="pane"
  xmlns="http://javafx.com/javafx/8" 
  xmlns:fx="http://javafx.com/fxml/1" 
  fx:controller="jp.tuyano.eclipsebook.WindowController">
  <Button text="Bye!" prefWidth="100" prefHeight="50" 
    onAction="#buttonAction" />
  <Button text="Welcome." prefWidth="100" prefHeight="50" 
    onAction="#buttonAction" />
  <Button text="Hello." prefWidth="100" prefHeight="50" 
    onAction="#buttonAction" />
</StackPane>

コメント

    コメントはありません