6.2 PanelThe Panel class provides a generic container within an existing display area. It is the simplest of all the containers. When you load an applet into Netscape Navigator or an appletviewer, you have a Panel to work with at the highest level. A Panel has no physical appearance. It is just a rectangular display area. The default LayoutManager of Panel is FlowLayout; FlowLayout is described in FlowLayout. Panel MethodsConstructors
Panel EventsIn Java 1.0, a Panel peer generates all the events that are generated by the Component class; it does not generate events that are specific to a particular type of component. That is, it generates key events, mouse events, and focus events; it doesn't generate action events or list events. If an event happens within a child component of a Panel, the target of the event is the child component, not the Panel. There's one exception to this rule: if a component uses the LightweightPeer (new to Java 1.1), it cannot be the target of an event. With Java 1.1, events are delivered to whatever listener is associated with a contained component. The fact that the component is within a Panel has no relevance. |
|