java - JavaFX close action controller -


i did try find answer on problem dont understand have do. want close window when cancel button pressed. in scenebuilder have cancelbtnaction declared , cancelbtn fx:id. have controller class

@fxml private button cancelbtn; @fxml public void cancelbtnaction() throws ioexception {     parent root = fxmlloader.load(getclass().getresource("loginfxml.fxml"));     stage stage = (stage)cancelbtn.getscene().getwindow();      stage.close();  } 

go easy on me 1st post, peace :)


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -