1 7 package java.awt; 8 9 import java.awt.peer.PanelPeer; 10 import javax.accessibility.*; 11 12 25 public class Panel extends Container implements Accessible { 26 private static final String base = "panel"; 27 private static int nameCounter = 0; 28 29 32 private static final long serialVersionUID = -2728009084054400034L; 33 34 39 public Panel() { 40 this(new FlowLayout ()); 41 } 42 43 48 public Panel(LayoutManager layout) { 49 setLayout(layout); 50 } 51 52 56 String constructComponentName() { 57 synchronized (getClass()) { 58 return base + nameCounter++; 59 } 60 } 61 62 66 67 public void addNotify() { 68 synchronized (getTreeLock()) { 69 if (peer == null) 70 peer = getToolkit().createPanel(this); 71 super.addNotify(); 72 } 73 } 74 75 79 88 public AccessibleContext getAccessibleContext() { 89 if (accessibleContext == null) { 90 accessibleContext = new AccessibleAWTPanel(); 91 } 92 return accessibleContext; 93 } 94 95 100 protected class AccessibleAWTPanel extends AccessibleAWTContainer { 101 102 private static final long serialVersionUID = -6409552226660031050L; 103 104 110 public AccessibleRole getAccessibleRole() { 111 return AccessibleRole.PANEL; 112 } 113 } 114 115 } 116 | Popular Tags |