The two most common windows are those derived front Panel class which is used by applets and those derived from frame class.
The window provided by Panel class does not contain a menubar, title bar, borders and resizing corners. Thus when an applet is executed in a browser, it does not show any border or title, as applets use window provided by the Panel class.
The Frame class inherits Window class. Generally, Window objects cannot be created and hence objects for its subclass Frame, are created. The window provided by the Frame contains menubar, title bar, borders and resizing controls. Also, Frame class can be used to create a window In a stand-alone application.
Method of Frame class, to make the frame visible
setSize(width,height) —to set the size for the frame window
Unless this method is invoked, a frame will not be visible on the scream.
A Frame class can also be used to create a window in applets, User-defined frame class can also be created by extending the predefined Frame class. Eg., class myframe extends Frame. As Frame is a subclass of components class, it also has paint( ) method.This method can be defined to display the desired contents.