Bugzilla – Attachment 125 Details for
Bug 354
Inclusion of a GLCanvas in a JFrame causes exception
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
The source file which shows the problem.
SimpleTest.java (text/plain), 1.79 KB, created by
Sven Gothel
on 2008-04-15 16:29:00 CEST
(
hide
)
Description:
The source file which shows the problem.
Filename:
MIME Type:
Creator:
Sven Gothel
Created:
2008-04-15 16:29:00 CEST
Size:
1.79 KB
patch
obsolete
>package test; > >import java.awt.BorderLayout; >import javax.media.opengl.*; >import javax.swing.*; > >public class SimpleTest implements GLEventListener >{ > public SimpleTest() { super(); } > > public void init(GLAutoDrawable drw) > { > drw.setGL(new DebugGL(drw.getGL())); > GL gl = drw.getGL(); > > gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); > gl.glLoadIdentity(); > } // init > > public void display(GLAutoDrawable drw) > { > GL gl = drw.getGL(); > > gl.glColor3f(1.0F, 0.4F, 0.0F); > > gl.glBegin(GL.GL_TRIANGLES); > gl.glVertex3f(0.0F, 0.0F, 0.0F); > gl.glVertex3f(1.0F, 0.0F, 0.0F); > gl.glVertex3f(1.0F, 1.0F, 0.0F); > gl.glEnd(); > } // display > > public void reshape(GLAutoDrawable drw, int x, int y, int wid, int hite) > { > } // reshape > > public void displayChanged(GLAutoDrawable drw, boolean modeCh, boolean devCh) > { > } // displayChanged > > public static void main(String[] argv) > { > GLCapabilities glCaps = new GLCapabilities(); > > // This line fails with the current (1.1.1.1-rc8 - February 22) build, > // but works if GLCanvas is changed to GLJPanel. With the 1.1.0 > // release build, it works either way. When it fails, the JFrame, when > // first made visible, crashes with an IllegalArgumentException deep > // inside the GL class heirarchy. > GLCanvas canv = new GLCanvas(glCaps); > > final JFrame fram = new JFrame("TestFrame"); > fram.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > fram.setSize(640, 480); > fram.getContentPane().add(canv, BorderLayout.CENTER); > canv.addGLEventListener(new SimpleTest()); > SwingUtilities.invokeLater(new Runnable() > { > public void run() > { > fram.setVisible(true); > } // run > }); > } // main >} // SimpleTest
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 354
: 125