Index: javax/swing/JCheckBox.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JCheckBox.java,v retrieving revision 1.16 diff -u -r1.16 JCheckBox.java --- javax/swing/JCheckBox.java 4 Aug 2005 15:47:31 -0000 1.16 +++ javax/swing/JCheckBox.java 12 Sep 2005 20:13:25 -0000 @@ -38,7 +38,9 @@ package javax.swing; +import javax.accessibility.Accessible; import javax.accessibility.AccessibleContext; +import javax.accessibility.AccessibleRole; /** * A small box that displays a check or not, depending on it's @@ -54,8 +56,32 @@ * * @author Ronald Veldema (address@hidden) */ -public class JCheckBox extends JToggleButton +public class JCheckBox extends JToggleButton implements Accessible { + + /** + * Provides accessibility support for JCheckBox. + */ + protected class AccessibleJCheckBox extends AccessibleJToggleButton + { + /** + * Creates a new instance of AccessibleJCheckBox. + */ + public AccessibleJCheckBox() + { + // Nothing to do here. + } + + /** + * Returns the accessble role of JCheckBox, + * address@hidden AccessibleRole#CHECK_BOX}. + */ + public AccessibleRole getAccessibleRole() + { + return AccessibleRole.CHECK_BOX; + } + } + private static final long serialVersionUID = -5246739313864538930L; public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY = @@ -118,14 +144,6 @@ } /** - * Gets the AccessibleContext associated with this JCheckBox. - */ - public AccessibleContext getAccessibleContext() - { - return null; - } - - /** * Returns a string that specifies the name of the Look and Feel class * that renders this component. */ @@ -148,5 +166,17 @@ { firePropertyChange("borderPaintedFlat", borderPaintedFlat, newValue); borderPaintedFlat = newValue; + } + + /** + * Returns the accessible context for this JCheckBox. + * + * @return the accessible context for this JCheckBox + */ + public AccessibleContext getAccessibleContext() + { + if (accessibleContext == null) + accessibleContext = new AccessibleJCheckBox(); + return accessibleContext; } } Index: javax/swing/JLayeredPane.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JLayeredPane.java,v retrieving revision 1.25 diff -u -r1.25 JLayeredPane.java --- javax/swing/JLayeredPane.java 23 Jul 2005 19:47:14 -0000 1.25 +++ javax/swing/JLayeredPane.java 12 Sep 2005 20:13:25 -0000 @@ -46,6 +46,8 @@ import java.util.TreeMap; import javax.accessibility.Accessible; +import javax.accessibility.AccessibleContext; +import javax.accessibility.AccessibleRole; /** * A container that adds depth to the usual Container semantics. @@ -116,6 +118,30 @@ */ public class JLayeredPane extends JComponent implements Accessible { + + /** + * Provides accessibility support for JLayeredPane. + */ + protected class AccessibleJLayeredPane extends AccessibleJComponent + { + /** + * Creates a new instance of AccessibleJLayeredPane. + */ + public AccessibleJLayeredPane() + { + // Nothing to do here. + } + + /** + * Returns the accessble role of JLayeredPane, + * address@hidden AccessibleRole#LAYERED_PANE}. + */ + public AccessibleRole getAccessibleRole() + { + return AccessibleRole.LAYERED_PANE; + } + } + private static final long serialVersionUID = 5534920399324590459L; public static final String LAYER_PROPERTY = "layeredContainerLayer"; @@ -641,5 +667,17 @@ public static void putLayer(JComponent component, int layer) { getLayeredPaneAbove(component).setLayer(component, layer); + } + + /** + * Returns the accessible context for this JLayeredPane. + * + * @return the accessible context for this JLayeredPane + */ + public AccessibleContext getAccessibleContext() + { + if (accessibleContext == null) + accessibleContext = new AccessibleJLayeredPane(); + return accessibleContext; } }