954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to program the Exit function from the JFrame window?

i have a public class named as clsbanking using JFrame, and then this frame has a menubar, that has FILE menuitem in it. the FILE menu has an Exit option which will actually close the whole frame for termination, unfortunately my codes doesnt work, what should be my code then. i hope u could help me guys :(

merci

psylocke
Newbie Poster
18 posts since Sep 2004
Reputation Points: 11
Solved Threads: 0
 

It'd help if we saw your code so we'd know what you did wrong. If your menu is set up correctly, then to exit you can use this: System.exit(0);

Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

Make sure you have the correct action listener for the exit menu. It'll be action performed.

nanosani
Unauthenticated Liar
Team Colleague
1,830 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
 

thanks a lot guys for the help, i will post my code right away. :) thanks again

psylocke
Newbie Poster
18 posts since Sep 2004
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You