SUI

Do someone know how to close window or frame by button from window self?

From a JFrame constructor call:

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

i need code that work in SlickUI

Slick-SUI is very old, no longer maintained, buggy, hackishly written, and slow/memory inefficient compared to TWL or Nifty-GUI. It’s best not to use it at all. :wink:

With that said, the Frame class provides a title bar and close button already. Clicking the close button closes the window. If you want to close the window from another button, you can simply hook an event to your button which calls myFrame.setVisible(false) when clicked.

thank you davedes