[Frame] A Frame is a top-level window with a title and a border. <详见java.awt.Frame>
[Panel] Panel is the simplest container class. A panel provides space in which an ap plication can attach any other component, including other panels. <详见java.awt.Panel>
初学Java的时候一直弄不清Frame和Panel的区别,都是在上面装组件,也没看出什么所以然,一直稀里糊涂地用。最近看来一下Java类库中几个主要类的源文件,才明白了一点所以然。写下了此文,希望能给大家一点帮助。让我们先看一看原始文件中的定义:[Frame]A Frame is a top-level window with a title and a border.