Where will the button be if you hide the JFrame?

You need to improve the question, providing a more complete thought of what you're trying to accomplish with specific questions about the design...