简体   繁体   中英

Change Expanded Titled Pane Background in JavaFx

I have an accordion with few titled pane. I want to change the background color of the titled pane when expanded. The default color seems to be white. How do I change it to black?

在此处输入图像描述

I've tried this css but it does not work.

.titled-pane > *.content {
    -fx-background-color: black;
    -fx-border-color: black;
}

Try this

.titled-pane > .title {  
    -fx-background-color: #000000;
    -fx-background-insets: 0; 
}

.titled-pane > .title > *.text {
    -fx-fill: #fff;
}

.titled-pane > .content {
    -fx-background-color: #000000;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM