- 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.
*翻译(来自网站,仅供参考):
Frame是java.awt包的一部分,因为JDK1.0存在。 JFrame的是javax.swing包的一部分,因为JDK1.1.3或东西存在。
Frame延伸窗口。
JFrame的扩展框架。
您可以直接添加组件Frame。您将组件添加到JFrame.getContentPane()。
JFrame的实现javax.swing.RootPaneContainer中和javax.accessibility.Accessible接口。Frame没有。凭借该JFrame的获取您在使用委托模型从JRootPane中得到的所有好处。例如您可以设置((JComponent中)JFrame.getRootPane())的边界。setBorder(…)
JFrame的直接支持javax.swing.JMenuBar中。
JFrame的支持关闭操作的设置。