【问题标题】:Change Accordion icon and position JavaFX更改 Accordion 图标和位置 JavaFX
【发布时间】:2013-02-22 12:23:38
【问题描述】:

我使用JavaFxScene Builder,我是新手,我想更改accordion 的图标及其位置,就像那个图像; 我找到了这个CSS,但我做不到;

.titled-pane .title{
-fx-background-radius: 30;
-fx-background-image:url('ac.jpg');
}

【问题讨论】:

标签: java css javafx


【解决方案1】:

这很简单,只需将 Hbox 添加到标题并在添加您想要的内容之后立即设置对齐(按钮,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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-03
    • 1970-01-01
    • 2020-04-04
    • 1970-01-01
    • 2013-02-04
    相关资源
    最近更新 更多