0
我使用JavaFx
与Scene Builder
,我是新手,我想更改accordion
的图标及其位置,如图像; 我觉得这个CSS
,但我不能那样做;更改手风琴图标和位置JavaFX
.titled-pane .title{
-fx-background-radius: 30;
-fx-background-image:url('ac.jpg');
}
我使用JavaFx
与Scene Builder
,我是新手,我想更改accordion
的图标及其位置,如图像; 我觉得这个CSS
,但我不能那样做;更改手风琴图标和位置JavaFX
.titled-pane .title{
-fx-background-radius: 30;
-fx-background-image:url('ac.jpg');
}
很容易,只需添加HBOX以头和后置alignement正确添加你想要的东西(按钮,ImageView的)
<TitledPane animated="false" collapsible="false" contentDisplay="RIGHT" layoutX="900.0" layoutY="500.0" prefHeight="206.0" prefWidth="431.0" stylesheets="@menu.css" text="Message" textFill="WHITE">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
<font>
<Font name="Arial Bold" size="12.0" />
</font>
<graphic>
<HBox alignment="TOP_RIGHT" prefHeight="24.0" prefWidth="352.0">
<children>
<ImageView fitHeight="21.0" fitWidth="18.0" pickOnBounds="true" preserveRatio="true" />
</children>
</HBox>
</graphic>
</TitledPane>
看到此相关的Q&A [如何改变标题组件在JavaFX中的TitledPane中](http://stackoverflow.com/q/11765436)。手风琴组件与标题栏有相同的css选择器,请参阅caspian.css。 – 2013-02-22 13:57:32
[如何更改JavaFX TitledPane中的标题组件]可能的重复(http://stackoverflow.com/questions/11765436/how-to-change-header-component-in-titledpane-in-javafx) – jewelsea 2013-02-22 19:31:34