1

TitledPane次のようなヘッダーにアイコン画像を表示するという問題を解決しました。

    <TitledPane fx:id="x2" text="Strukturen">
            <graphic>
                <ImageView >
                        <image>
                            <Image url="@/de/myres/icons/arrow-out.png" />
                        </image>
                </ImageView>
            </graphic>
            <content>
                    <AnchorPane id="Content" minHeight="0.0" minWidth="0.0"
                        prefHeight="180.0" prefWidth="200.0" />
            </content>
            </TitledPane>

これは次のようになります。

アイコン付きの TitledPane ヘッダー

ご覧のとおり、折りたたむための矢印とこのアイコンが直接並んで表示されると、見栄えがよくありません。

タイトルバーの右側にアイコンを表示するにはどうすればよいですか?

4

1 に答える 1

2

TitledPane テキストを空白のままにして、アイコン ノードを、左側に Label を含み、右側に ImageView を含む HBox に設定することができます。

于 2012-09-16T16:23:20.653 に答える