Bugzilla – Attachment 263 Details for
Bug 499
Simple AWT and JOGL application hangs on startup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
SimpleScene V2
SimpleScene.java (text/plain), 2.17 KB, created by
Sven Gothel
on 2011-08-30 22:23:49 CEST
(
hide
)
Description:
SimpleScene V2
Filename:
MIME Type:
Creator:
Sven Gothel
Created:
2011-08-30 22:23:49 CEST
Size:
2.17 KB
patch
obsolete
>import java.awt.Frame; >import java.awt.event.WindowAdapter; >import java.awt.event.WindowEvent; >import javax.media.opengl.*; >import javax.media.opengl.awt.GLCanvas; >import com.jogamp.common.GlueGenVersion; >import com.jogamp.common.util.VersionUtil; >import com.jogamp.opengl.JoglVersion; > >public class SimpleScene { > > public static Frame frame = null; > > public static void main(String[] args) { > System.err.println(VersionUtil.getPlatformInfo()); > System.err.println(GlueGenVersion.getInstance()); > System.err.println(JoglVersion.getInstance()); > > GLProfile glp = GLProfile.getDefault(); > GLCapabilities caps = new GLCapabilities(glp); > final GLCanvas canvas = new GLCanvas(caps); > canvas.addGLEventListener( new GLEventListener() { > public void init( GLAutoDrawable glautodrawable ) { > GL gl = glautodrawable.getGL(); > System.err.println("init: "+gl.getContext()); > } > public void dispose( GLAutoDrawable glautodrawable ) { > System.err.println("dispose"); > } > public void display( GLAutoDrawable glautodrawable ) { > } > public void reshape( GLAutoDrawable glautodrawable, int x, int y, int width, int height ) { > } > }); > > frame = new Frame("AWT Window Test"); > frame.setSize(300, 300); > frame.add(canvas); > frame.setVisible(true); > > // by default, an AWT Frame doesn't do anything when you click > // the close button; this bit of code will terminate the program when > // the window is asked to close > frame.addWindowListener(new WindowAdapter() { > public void windowClosing(WindowEvent e) { > frame.dispose(); > System.exit(0); > } > }); > > // wait 3s then end .. > try { > Thread.sleep(3000); > javax.swing.SwingUtilities.invokeAndWait(new Runnable() { > public void run() { > frame.remove(canvas); > frame.dispose(); > }}); > } catch( Throwable throwable ) { > throwable.printStackTrace(); > } > > } >} > >
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 499
:
254
|
255
| 263 |
264