In most cases we extend JFrame within a class so that you can do all initialization within your constructor. And in a typical application you will have many Internal frames, panels etc. And trying to initialize them all through in the main method is bad design and not maintainable. And for better separation of concern we move to a different class which extends from JFrame to construct new frames.
Hope that helps
if who i am is what i have, and what i have is lost, then who am i?<br /> <br />SCJP 5.0<br />SCWCD 1.4<br />SCBCD preparing
I don't know what Example 1 is trying to do. The SimpleFrame class is never used.
In general you should only extend a class to provide new functionality. Setting a few properties does not provide new functionalicy. Search the web using "composition vs inheritance" to find all kinds on discussions.
For what its worth you can also look at the Sun tutorial examples, which do NOT extend JFframe.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop