javafx - make ListView not selectable via mouse

前端 未结 7 2195
执念已碎
执念已碎 2020-12-20 16:33

Is there an option in JavaFX to deactivate the possibility to select the items in a ListView via mouse?

I\'d like to just display a ListView

7条回答
  •  情深已故
    2020-12-20 17:00

    Try in the code:

    list.setFocusTraversable( false );
    

    and in CSS

    .list-cell:odd, .list-cell:even
    {
        -fx-background-color: white;
        -fx-text-fill: black;
    }
    

提交回复
热议问题