3.2.9コントロールの表示調整
続いて、コントロール類の表示について目を向けましょう。FXMLを利用したコントロールの表示は、さまざまな属性を使うことで整えられます。実際に簡単な表示の調整を行ってみましょう。window.fxmlを次のように書き換えてください。
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.text.*?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane 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">
<top>
<Label fx:id="label1" text="this is FXML sample!"
BorderPane.alignment="TOP_LEFT">
<font>
<Font name="System Bold" size="18.0" />
</font>
<BorderPane.margin>
<Insets
この記事は会員限定です。会員登録をすると続きをお読みいただけます。
ログイン / 新規登録