src/java.desktop/share/classes/java/awt/MenuComponent.java

Print this page

        

*** 28,37 **** --- 28,39 ---- import java.awt.event.ActionEvent; import java.io.IOException; import java.io.ObjectInputStream; import sun.awt.AppContext; import sun.awt.AWTAccessor; + import sun.awt.ComponentFactory; + import javax.accessibility.*; import java.security.AccessControlContext; import java.security.AccessController;
*** 182,191 **** --- 184,201 ---- return null; // For strict compliance with prior platform versions, a MenuComponent // that doesn't set its name should return null from // getName() } + final ComponentFactory getComponentFactory() { + final Toolkit toolkit = Toolkit.getDefaultToolkit(); + if (toolkit instanceof ComponentFactory) { + return (ComponentFactory) toolkit; + } + throw new AWTError("Unsupported toolkit: " + toolkit); + } + /** * Gets the name of the menu component. * @return the name of the menu component * @see java.awt.MenuComponent#setName(java.lang.String) * @since 1.1