ok, here is the testcase that reproduces this error on Mac. just run and compile with jogl on classpath and click in the window, so that the popup is half above the glcanvas.
please note, that i am forcing the metal-lookandfeel. it seems to work on the standard-mac-lookandfeel which looks like this aqua thingy.
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSplitPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import com.sun.opengl.util.Animator;
public class PopupTest implements GLEventListener {
public static void main(String [] args) {
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
try {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
new PopupTest();
}
public PopupTest() {
JFrame frame = new JFrame("hello");
frame.setSize(400, 400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JSplitPane splitpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
frame.add(splitpane);
final JPanel top = new JPanel(new GridLayout(1, 1));
splitpane.setRightComponent(top);
top.setMinimumSize(new Dimension(100,100));
top.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
JPopupMenu menu = new JPopupMenu("popup");
menu.setLayout(new BorderLayout());
JLabel biglabel = new JLabel("<html>some
text
with
line
breaks</html>");
menu.add(biglabel, BorderLayout.CENTER);
menu.show(top, e.getX(), e.getY()-100);
}
});
JPanel bottom = new JPanel(new GridLayout(1, 1));
splitpane.setLeftComponent(bottom);
bottom.setMinimumSize(new Dimension(100,100));
GLCanvas canvas = new GLCanvas(new GLCapabilities());
bottom.add(canvas);
canvas.addGLEventListener(this);
canvas.setMinimumSize(new Dimension(100,100));
Animator animator = new Animator(canvas);
animator.start();
frame.setVisible(true);
splitpane.setDividerLocation(0.5);
}
float a = 0;
@Override
public void display(GLAutoDrawable arg0) {
GL gl = arg0.getGL();
gl.glClearColor(0,(float) (Math.sin(a)+1)*0.3f,0,0);
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
a += 0.01f;
}
@Override
public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {}
@Override
public void init(GLAutoDrawable arg0) {}
@Override
public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {}
}