Please notice that InnerJFrame have to be declared static in this implementation, otherwise error of "non-static variable this cannot be referenced from a static context" will be complained. It's because instance of non-static inner class(InnerJFrame) can exist only within an instance of outer class(JavaJFrameApplication). At the time of main() run, object of JavaJFrameApplication have not been instantiated.