我正在使用NetBeans和Scene Builder构建应用程序。我有一个TabPane,但是,我希望在点击btnAnonymousClientClick
时禁用窗格中的第三个标签,我该怎么做呢?
我的代码:
public class FXMLDocumentController implements Initializable {
@FXML
private Button btnCreateAnonymousClient;
@FXML
private Button btnCancel;
@FXML
private TextField txtAnonymousClientFirstName;
@FXML
private Label lblFirstName;
@FXML
private Label lbl;
@FXML
private TabPane tabControlPane;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
@FXML
private void btnAnonymousClientClick(ActionEvent event) {
}
@FXML
private void btnAnonymousClientCancel(ActionEvent event) {
}
}
答案 0 :(得分:1)
您可以通过向其添加fx:id并将其添加到代码来禁用Tab。
@FXML
private Tab yourTabFXID
yourTabFXID.setDisable(true);