added the frame as an argument to the joptionpanes