Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  An unexpected exception has been detected in nativ  (Read 2067 times)
0 Members and 1 Guest are viewing this topic.
Offline sss

Senior Newbie

Java games rock!

« Posted 2003-09-18 15:49:56 »

The following pretty simple program blows up with an exception in the VM.  All the code does is draw a cube and if you click in the window it opens another window with another cube.

Any idea how to get around this problem?

import java.awt.*;
import java.awt.event.*;


public class Cube {
     public static void main(String[] args) {
           Cube c = new Cube(0, 0);
     public Cube(int x, int y) {      
           Frame frame = new Frame("Cube Demo");      
           GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
           canvas.addGLEventListener(new CubeRenderer());
           frame.setSize(300, 300);
           frame.setLocation(new Point(x,y));

           frame.addWindowListener(new WindowAdapter() {
                 public void windowClosing(WindowEvent e) {
static class CubeRenderer implements GLEventListener, MouseListener{
     int x=0, y=0;
     public void init(GLDrawable drawable) {
       GL gl = drawable.getGL();
     public void reshape(GLDrawable drawable, int x, int y, int width, int height) {
           GLU glu = drawable.getGLU();
           GL gl = drawable.getGL();
           gl.glViewport(x, y, width, height);
                 gl.glOrtho(-(double)width/height, (double)width/height, -1, 1, -1, 1);
                 gl.glOrtho(-1, 1, -(double)height/width, (double)height/width, -1, 1);


     public void display(GLDrawable drawable) {      
           GL gl = drawable.getGL();
           GLUT glut = new GLUT();
           gl.glColor3d(1, .25, .75);

                 glut.glutSolidCube(gl, 1);
     public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
     public void mouseEntered(MouseEvent e) {}
     public void mouseExited(MouseEvent e) {}
     public void mousePressed(MouseEvent e) { }  
     public void mouseReleased(MouseEvent e) {}
     public void mouseClicked(MouseEvent e) {new Cube(x+=100, y+=100);}

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x69350594

Current Java thread:
     at Method)
     - locked <0x10058138> (a
     - locked <0x10058138> (a
     - locked <0x10058138> (a
     at java.awt.Component.setBounds(Unknown Source)
     at java.awt.BorderLayout.layoutContainer(Unknown Source)
     - locked <0x1050de98> (a java.awt.Component$AWTTreeLock)
     at java.awt.Container.layout(Unknown Source)
     at java.awt.Container.doLayout(Unknown Source)
     at java.awt.Container.validateTree(Unknown Source)
     at java.awt.Container.validate(Unknown Source)
     - locked <0x1050de98> (a java.awt.Component$AWTTreeLock)
     at Source)
     at JOGLstructuredArguments.Cube.<init>(
     at JOGLstructuredArguments.Cube$CubeRenderer.mouseClicked(
     at java.awt.Component.processMouseEvent(Unknown Source)
     at java.awt.Component.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at Source)

Dynamic libraries:
0x00400000 - 0x00407000       C:\Program Files\Java\j2re1.4.2\bin\javaw.exe
0x77F50000 - 0x77FF7000       C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000       C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5D000       C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78086000       C:\WINDOWS\system32\RPCRT4.dll
0x77D40000 - 0x77DC6000       C:\WINDOWS\system32\USER32.dll
0x77C70000 - 0x77CB0000       C:\WINDOWS\system32\GDI32.dll
0x77C10000 - 0x77C63000       C:\WINDOWS\system32\MSVCRT.dll
0x629C0000 - 0x629C8000       C:\WINDOWS\System32\LPK.DLL
Pages: [1]
  ignore  |  Print  

EgonOlsen (37 views)
2018-06-10 19:43:48

EgonOlsen (20 views)
2018-06-10 19:43:44

EgonOlsen (39 views)
2018-06-10 19:43:20

DesertCoockie (186 views)
2018-05-13 18:23:11

nelsongames (122 views)
2018-04-24 18:15:36

nelsongames (121 views)
2018-04-24 18:14:32

ivj94 (861 views)
2018-03-24 14:47:39

ivj94 (122 views)
2018-03-24 14:46:31

ivj94 (758 views)
2018-03-24 14:43:53

Solater (139 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!