私も同じ問題に直面しています。
クイックフィックス:
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
class WindowOpaqueTest2{
public JComponent makeUI() {
JPanel p = new JPanel();
p.setBackground(new Color(.5f,.5f,.5f,.5f));
p.add(new JComboBox<String>(new String[] {"aaa", "bb", "c"}));
JComboBox c = new JComboBox<String>(new String[] {"aaa", "bb", "c"});
c.addPopupMenuListener(new PopupMenuListener() {
@Override public void popupMenuWillBecomeVisible(final PopupMenuEvent e) {
EventQueue.invokeLater(new Runnable() {
@Override public void run() {
JComboBox c = (JComboBox)e.getSource();
Object o = c.getAccessibleContext().getAccessibleChild(0);
if(o instanceof JComponent) { //BasicComboPopup
((JComponent)o).repaint();
}
}
});
}
@Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}
@Override public void popupMenuCanceled(PopupMenuEvent e) {}
});
p.add(c);
return p;
}
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override public void run() { createAndShowGUI(); }
});
}
public static void createAndShowGUI() {
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame f = new JFrame();
//com.sun.awt.AWTUtilities.setWindowOpaque(f, false);
f.setBackground(new Color(0,true)); //1.7.0
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.getContentPane().add(new WindowOpaqueTest2().makeUI());
f.setSize(320, 240);
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
1はあなたを助けることができるように、たぶん、あなたは、コードのいくつかの作品を提供しますか? – Jagger