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.

*翻译(来自网站,仅供参考)
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的支持关闭操作的设置。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值