I want to make a button on an AnchorPane without drag it from the library in the FXML file I want to do it progammatically: if the search button clicked, should show a new button not existed in the AnchorPane before I did this code but I don't know what is wrong with it:
private void searchButton(ActionEvent evt) { Button tab = new Button(); tab.setLayoutX(147); tab.setLayoutY(102); tab.setText("Tab1"); tab.setPrefHeight(27); tab.setPrefWidth(69); WebView wb = new WebView(); wb.setLayoutX(-1); wb.setLayoutY(128); wb.setPrefWidth(1604); wb.setPrefWidth(700); }
Buttonto anything in the scene graph.