AccessibleContext () { // Most of the accessibility properties come from the right component if (myPanel.getComponentCount() >= 2) { Component c = myPanel.getComponent(1); if (c instanceof Accessible) { return c.getAccessibleContext(); } } // Fallback to JPanel if our right component is not accessible return getDefaultAccessibleContext(); }