How to close the root Stage when opening a new one in javafx?

Asked

Viewed 95 times

0

I’m trying to create a button, which, when clicking, opens another screen.

However, when opening the second screen it keeps the first.

I would like to know how to close the first screen and the second to open when clicking the button.

Button event:

Home screen:

inserir a descrição da imagem aqui

  • close() the first window before calling the other window does not resolve?

  • gives an error when I try to use this.close(); http://prntscr.com/mnynrv

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.