I’ve just upgraded to Mustang build 70 from build 66. The latest release gives some bad flickering when mixing swing and GLCanvas. In the below example, you can see tis by pressing and holding the button along the bottom of the window, or by right clicking in the GLCanvas are to bring up a popup menu. For some reason, the popup menu only flickers some of the time.
`/*
- TestFrame.java
- Created on February 1, 2006, 11:35 AM
*/
package com.pantometrics.display;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import net.java.games.jogl.Animator;
import net.java.games.jogl.GLCapabilities;
import net.java.games.jogl.GLDrawable;
import net.java.games.jogl.GLDrawableFactory;
/**
*
-
@author kitfox
*/
public class TestJOGLFrame extends javax.swing.JFrame
{
private GLDrawable canvas;
Animator animator;/** Creates new form TestFrame */
public TestJOGLFrame()
{
canvas = GLDrawableFactory.getFactory().createGLJPanel(new GLCapabilities());add((Component)canvas, BorderLayout.CENTER); animator = new Animator((GLDrawable)canvas); animator.start(); getContentPane().add((Component)canvas, BorderLayout.CENTER); setSize(640, 480);
}
/** This method is called from within the constructor to
-
initialize the form.
-
WARNING: Do NOT modify this code. The content of this method is
-
always regenerated by the Form Editor.
*/
//
private void initComponents()
{
popup_main = new javax.swing.JPopupMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
jButton1 = new javax.swing.JButton();popup_main.setLightWeightPopupEnabled(false);
jMenuItem1.setText(“Item”);
popup_main.add(jMenuItem1);jMenuItem2.setText(“Item”);
popup_main.add(jMenuItem2);setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText(“jButton1”);
getContentPane().add(jButton1, java.awt.BorderLayout.SOUTH);pack();
}//
/**
-
@param args the command line arguments
*/
public static void main(String args[])
{
java.awt.EventQueue.invokeLater(new Runnable()
{
public void run()
{
new TestFrame().setVisible(true);
}
});
}
class Popup implements MouseListener
{
public void mouseClicked(MouseEvent e)
{
}public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { popup_main.show(e.getComponent(), e.getX(), e.getY()); } } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { popup_main.show(e.getComponent(), e.getX(), e.getY()); } } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { }
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JPopupMenu popup_main;
// End of variables declaration -
}
`