Why do we need to extend the JFrame class when building a Swing application. As far as I know extends is used for inheriting the base class. None o
If you want to create a standalone application, you can either extend JPanel or JFrame or create their instance in your class implementation.
As a rule, a standalone application with a Swing-based GUI has at least one containment hierarchy with a JFrame as its root. For example, if an application has one main window and two dialogs, then the application has three containment hierarchies, and thus three top-level containers. http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html?
http://docs.oracle.com/javase/tutorial/uiswing/components/frame.html