Yes, and also remember to have your main class to ' extends JFrame ' that will take the above effects James advised.

Good luck! :)