Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding the main window menu

Status
Not open for further replies.

mfalomir

Technical User
Feb 6, 2003
78
MX
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 ?

Thanks in advance :)
 
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 ?

Thanks in advanced
 
Code:
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.
Code:
yourJFrame.setDeafaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top