FileDocCategorySizeDatePackage
Panel.javaAPI DocJava SE 5 API3169Fri Aug 26 14:56:46 BST 2005java.awt

Panel

public class Panel extends Container implements Accessible
Panel is the simplest container class. A panel provides space in which an application can attach any other component, including other panels.

The default layout manager for a panel is the FlowLayout layout manager.

version
1.35, 03/01/04
author
Sami Shaio
see
java.awt.FlowLayout
since
JDK1.0

Fields Summary
private static final String
base
private static int
nameCounter
private static final long
serialVersionUID
Constructors Summary
public Panel()
Creates a new panel using the default layout manager. The default layout manager for all panels is the FlowLayout class.


                             
      
	this(new FlowLayout());
    
public Panel(LayoutManager layout)
Creates a new panel with the specified layout manager.

param
layout the layout manager for this panel.
since
JDK1.1

	setLayout(layout);
    
Methods Summary
public voidaddNotify()
Creates the Panel's peer. The peer allows you to modify the appearance of the panel without changing its functionality.

        synchronized (getTreeLock()) {
	    if (peer == null)
	        peer = getToolkit().createPanel(this);
	    super.addNotify();
	}
    
java.lang.StringconstructComponentName()
Construct a name for this component. Called by getName() when the name is null.

        synchronized (getClass()) {
	    return base + nameCounter++;
	}
    
public javax.accessibility.AccessibleContextgetAccessibleContext()
Gets the AccessibleContext associated with this Panel. For panels, the AccessibleContext takes the form of an AccessibleAWTPanel. A new AccessibleAWTPanel instance is created if necessary.

return
an AccessibleAWTPanel that serves as the AccessibleContext of this Panel

        if (accessibleContext == null) {
            accessibleContext = new AccessibleAWTPanel();
        }
        return accessibleContext;