1
It is possible by clicking a button and the JFrame
be closed as if you had clicked on the window X? If possible, how do I create it?
From what I’ve studied is using ActionListener
but I can’t find the code to close the window.
1
It is possible by clicking a button and the JFrame
be closed as if you had clicked on the window X? If possible, how do I create it?
From what I’ve studied is using ActionListener
but I can’t find the code to close the window.
3
It is possible yes, you set a Switch to the button and inside it, invoke the method dispose()
of the instance of JFrame
you want to close inside this System:
botao.addActionListener(e -> seuFrame.dispose());
Browser other questions tagged java swing jframe
You are not signed in. Login or sign up in order to post.
Just one more question and it is possible to call the frame I used.Ispose(); dnv if you want?
– Bits of Bytes
@Bitsofbytes if it is the only frame of the application, no, because JVM will close the application. If you have others, you need to create a new instance.
– user28595
the application of more than 1 frame as I do?
– Bits of Bytes
@Bitsofbytes don’t understand what you’re saying.
– user28595
let me know how I’m gonna do it
– Bits of Bytes