How to create tabs with icons in JavaFX

后端 未结 3 430
抹茶落季
抹茶落季 2021-02-04 12:04

I want to create tabs panel with icons similar to the Firefox configuration panel with JavaFX:

\"enter

3条回答
  •  -上瘾入骨i
    2021-02-04 12:43

    I know its an old thread, but i didnt find a direct answer anywhere. So i thought of posting it some that it will be helpfull for some searching for it.

    This is what i did to get a tab like firefox preferences screen.

    Add the image to the tab with setGraphics and add the following code to the application css file. My image size was 48x48. So i went for height as 70.

    .tab-label {
        -fx-content-display: top;
    }
    .tab-pane {
        -fx-tab-min-height: 70;
        -fx-tab-max-height: 70;
    }
    

提交回复
热议问题