FileDocCategorySizeDatePackage
CustomMenuItemUI.javaAPI DocExample942Mon Jan 09 11:01:58 GMT 2006None

CustomMenuItemUI

public class CustomMenuItemUI extends BasicMenuItemUI

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

        return new CustomMenuItemUI();
    
public voidpaint(java.awt.Graphics g, javax.swing.JComponent comp)

        // paint to the buffered image
        BufferedImage bufimg = new BufferedImage(comp.getWidth(),comp.getHeight(),
            BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = bufimg.createGraphics();        
        // restore the foreground color in case the super class needs it
        g2.setColor(g.getColor());
        super.paint(g2,comp);
        // do an alpha composite
        Graphics2D gx = (Graphics2D) g;
        gx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.8f));
        gx.drawImage(bufimg,0,0,null);