JFrame 与 Frame

JFrame是Frame的子类

    1. 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.
    2. Frame extends Window.
      JFrame extends Frame.
    3. You can directly add components to Frame. You add components to JFrame.getContentPane().
    4. 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(...)
    5. JFrame directly supports javax.swing.JMenuBar.
    6. JFrame supports setting of close operation.

。。。未完待续

原文地址:https://www.cnblogs.com/deltadeblog/p/8092720.html