How to change header component in TitledPane in JavaFX

前端 未结 4 1503
栀梦
栀梦 2020-12-03 08:51

I cannot find an answer about this anywhere on the internet.

I have an application that has to have collapsable panels, so the TitledPane and Accordion set-up in Jav

4条回答
  •  孤城傲影
    2020-12-03 09:14

    (Moved answer from question)

    This is the answer:

    To remove the arrow, add this CSS declaration:

    .titled-pane > .title > .arrow-button .arrow{
        -fx-shape: "";
    }
    

    The above CSS snippet will remove the arrow, but the space for the arrow is still occupied. This was really tricky and I couldn't find it documented anywhere on the internet, but I applied this CSS statement and it removed the gap from the arrow.

    .titled-pane > .title{
       -fx-padding: 0 0 0 -4;
    }
    

    This may not be the best solution, but it is a solution that has worked for my needs.

提交回复
热议问题