Line 8 is typically unnecessary because you call show() from outside the object (in main()).

What is main() doing? How are you creating/destroying a MyFrame instance?