Hi, Im developing a Java app that has an horizontal menu bar,which has the option to exit the program . So I want to hide, or get rid of the main window menu bar, the one that has the close, minimize and maximize buttons..is it possible ?
Yes, it is a Frame, the thing is that when the user close the window using the option on my menu a function gets executed before exiting the application. So, is there a way to call a method when the users closes the window ?
yourJFrame.addWindowListener( new WindowAdapter(){
public void windowClosing( WindowEvent e ){
[b][i]code to run when JFrame is closing[/i][/b]
}
public void windowClosed( WindowEvent e ){
[b][i]code to run when JFrame is closed.[/i][/b]
}
}
BTW, yourJFrame should have the following set when it is created.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.