JavaFX & FXML: how do I set the default selected item in a ChoiceBox in FXML?

前端 未结 3 837
走了就别回头了
走了就别回头了 2021-01-04 04:17

I have the following FXML:


    
        
            

        
3条回答
  •  情深已故
    2021-01-04 05:11

    First, you should import your needed value model, like Crowell answer, you should import like this in your fxml header:

    
    

    Second, if you want's import your own model, import it first and then like this:

    
    ....
    
    
          
                
                      
                      
                
          
    
    

提交回复
热议问题