What is the difference between a Frame and a JFrame?
- Frame is part of java.awt package and exists since JDK1.0. JFrame is part of javax.swing package and exists since JDK1.1.3 or something.
Frame extends Window.
JFrame extends Frame.
- You can directly add components to Frame. You add components to JFrame.getContentPane().
- JFrame implements javax.swing.RootPaneContainer and javax.accessibility.Accessible interface. Frame does not. By virtue of that JFrame gets all the benefits that you get from JRootPane using a delegation model. e.g. you can set the border on ((JComponent) JFrame.getRootPane()).setBorder(...)
- JFrame directly supports javax.swing.JMenuBar.
- JFrame supports setting of close operation.