FileDocCategorySizeDatePackage
CustomPopupMenuUI.javaAPI DocExample666Mon Jan 09 11:01:58 GMT 2006None

CustomPopupMenuUI.java

import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.plaf.metal.*;
import javax.swing.plaf.basic.*;

public class CustomPopupMenuUI extends BasicPopupMenuUI {
    
    public static ComponentUI createUI(JComponent c) {
        return new CustomPopupMenuUI();
    }
    
    public void installUI(JComponent c) {
        super.installUI(c);
        popupMenu.setOpaque(false);
    }
    
    public Popup getPopup(JPopupMenu popup, int x, int y) {
        Popup pp = super.getPopup(popup,x,y);
        JPanel panel = (JPanel)popup.getParent();
        panel.setOpaque(false);
        return pp;
    }
    
}