I am designing a simple applet, that is a review programme for movies.

I have a main class that extends jframe.

I have figured it out so far but I want to create a joption pane that when you click the exit button

a JoptionPane that says

do you wish to exit

yes no

that exits

now I know how to code the joption pane, but how do you get it to work?