I have a problem with this code
public static void main(String[] args) {
final GLProfile profile = GLProfile.get(GLProfile.GL2);
GLCapabilities capabilities = new GLCapabilities(profile);
final GLCanvas glcanvas = new GLCanvas(capabilities);
MainRender r = new MainRender();
glcanvas.addGLEventListener(r);
glcanvas.setSize(700, 400);
final FPSAnimator animator = new FPSAnimator(glcanvas, 300, true);
final JFrame frame = new JFrame("Render");
frame.getContentPane().add(glcanvas);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
if (animator.isStarted())
animator.stop();
System.exit(0);
}
});
frame.setSize(frame.getContentPane().getPreferredSize());
frame.setLocationRelativeTo(null);
frame.setVisible(true);
JPanel p = new JPanel();
p.setPreferredSize(new Dimension(0, 0));
frame.add(p, BorderLayout.SOUTH);
keyBindings(p, frame, r);
animator.start();
Handler h = new Handler();
p.addMouseListener(new Handler());
p.addMouseMotionListener(new Handler());
}
At the Handler h = new Handler(); Eclipse shows this message
No enclosing instance of type MainRender is accessible. Must qualify the allocation with an enclosing instance of type MainRender (e.g. x.new A() where x is an instance of MainRender).
Any solutions?