Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (683)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (750)
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 1482 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  
You cannot reply to this message, because it is very, very old.

orrenravid (190 views)
2016-07-16 03:57:23

theagentd (261 views)
2016-07-11 14:28:54

Hydroque (345 views)
2016-07-06 05:56:57

Hydroque (493 views)
2016-07-03 08:52:54

GrandCastle (376 views)
2016-07-01 09:13:47

GrandCastle (367 views)
2016-07-01 09:09:45

CopyableCougar4 (422 views)
2016-06-25 16:56:52

Hydroque (401 views)
2016-06-22 02:17:53

SwampChicken (365 views)
2016-06-20 13:22:57

SwampChicken (298 views)
2016-06-20 13:22:49
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17 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!