FileDocCategorySizeDatePackage
WindowsMenuItemUI.javaAPI DocJava SE 5 API1707Fri Aug 26 14:54:50 BST 2005com.sun.java.swing.plaf.windows

WindowsMenuItemUI

public class WindowsMenuItemUI extends BasicMenuItemUI
Windows rendition of the component.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.

Fields Summary
Constructors Summary
Methods Summary
public static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)

	return new WindowsMenuItemUI();
    
protected voidpaintText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text)
Method which renders the text of the current menu item.

param
g Graphics context
param
menuItem Current menu item to render
param
textRect Bounding rectangle to render the text.
param
text String to render


	ButtonModel model = menuItem.getModel();
        Color oldColor = g.getColor();

        if(model.isEnabled() &&
            (model.isArmed() || (menuItem instanceof JMenu &&
             model.isSelected()))) {
            g.setColor(selectionForeground); // Uses protected field.
        }

        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);

        g.setColor(oldColor);