Advertisement
Guest User

Untitled

a guest
Nov 14th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. package com.test.structure.wb;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.Container;
  5. import javax.media.opengl.awt.GLCanvas;
  6. import javax.swing.JFrame;
  7. import javax.swing.JPanel;
  8. import javax.swing.JSplitPane;
  9. import javax.media.opengl.GLCapabilities;
  10. import javax.media.opengl.GLProfile;
  11. import com.jogamp.opengl.util.FPSAnimator;
  12.  
  13. public class JoglTest extends JFrame { 
  14.     private static final long serialVersionUID = 1L;
  15.  
  16.     public static void main(String[] args) {
  17.         new JoglTest();
  18.     }
  19.    
  20.     public JoglTest() {
  21.         Container contentPane = getContentPane();
  22.        
  23.         JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  24.         splitPane.setResizeWeight(0.5d);
  25.  
  26.         GLCanvas gc = new GLCanvas(new GLCapabilities(GLProfile.getDefault()));
  27.         splitPane.setLeftComponent(gc);
  28.         splitPane.setRightComponent(new JPanel());     
  29.         contentPane.add(splitPane, BorderLayout.CENTER);
  30.  
  31.         FPSAnimator animator = new FPSAnimator(gc, 100);
  32.         animator.start();
  33.        
  34.         pack();
  35.         setVisible(true);
  36.         setSize(new java.awt.Dimension(824,568));
  37.     }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement