How do you change the background color of a TextField without changing the border in javafx?

后端 未结 4 1454
离开以前
离开以前 2020-12-31 10:00

I am trying to change the background color of my TextField \"colorBox0\" to \"value0\" but it gets rid of the border.
Here is a simplified version of my code:

         


        
4条回答
  •  情深已故
    2020-12-31 10:21

    Try to set the color using CSS:

    TextField colorBox0;
    colorBox0.setStyle("-fx-background-color: white;");
    

提交回复
热议问题