What is the difference between a Frame and a JFrame?

Sandip Chitale

  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.
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact