Bugzilla – Attachment 449 Details for
Bug 712
Using GLCanvas and the SWT_AWT bridge reveals a JavaEmbeddedFrame when ran with Java 7
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Sample code (needs JOGL and swt.jar) that illustrates the GLCanvas bug when ran on linux with java 7
GLSWT.java (text/x-java), 1.40 KB, created by
Bart Adams
on 2013-04-03 15:29:23 CEST
(
hide
)
Description:
Sample code (needs JOGL and swt.jar) that illustrates the GLCanvas bug when ran on linux with java 7
Filename:
MIME Type:
Creator:
Bart Adams
Created:
2013-04-03 15:29:23 CEST
Size:
1.40 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.awt.SWT_AWT; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >import javax.media.opengl.awt.GLCanvas; >import java.awt.*; > >/** > * Short program to illustrate a JOGL bug when GLCanvas is used > * using the SWT_AWT bridge on linux with Java 7. > * > * Needs swt.jar and the JOGL libraries. > */ >public class GLSWT { > public static void main( String[] args ) { > Display display = new Display(); > > Shell shell = new Shell( display, SWT.SHELL_TRIM ); > shell.setLayout( new FillLayout() ); > shell.setText( "SWT Application" ); > shell.setSize( 640, 480 ); > > Composite composite = new Composite( shell, SWT.EMBEDDED | SWT.NO_BACKGROUND ); > composite.setLayout( new FillLayout() ); > > final Frame frame = SWT_AWT.new_Frame( composite ); > > frame.setLayout( new BorderLayout() ); > > // Regular Canvas works > // frame.add( new Canvas(), BorderLayout.CENTER ); > > // GLCanvas does not work: shows separate JavaEmbeddedFrame and sometimes enters into an infinite loop of destroying and creating a new frame. > frame.add( new GLCanvas(), BorderLayout.CENTER ); > > shell.open(); > while ( !shell.isDisposed() ) { > if ( !display.readAndDispatch() ) { > display.sleep(); > } > } > display.dispose(); > System.exit( 0 ); > } >}
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 712
: 449