示例#1
0
 private void createWindow() {
   JFrame window = new JFrame();
   LwjglAWTCanvas canvas = new LwjglAWTCanvas(new AnimationTest(), canvas1);
   window.getContentPane().add(canvas.getCanvas(), BorderLayout.CENTER);
   window.pack();
   window.setVisible(true);
   window.setSize(200, 200);
 }
示例#2
0
  @Override
  public void dispose() {
    canvas3.stop();
    canvas2.stop();
    canvas1.stop();

    super.dispose();
  }
示例#3
0
  public SwingLwjglTest() {
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    Container container = getContentPane();
    canvas1 = new LwjglAWTCanvas(new MusicTest());
    canvas2 = new LwjglAWTCanvas(new UITest(), canvas1);
    canvas3 = new LwjglAWTCanvas(new WindowCreator(), canvas1);

    canvas1.getCanvas().setSize(200, 480);
    canvas2.getCanvas().setSize(200, 480);
    canvas3.getCanvas().setSize(200, 480);

    container.add(canvas1.getCanvas(), BorderLayout.LINE_START);
    container.add(canvas2.getCanvas(), BorderLayout.CENTER);
    container.add(canvas3.getCanvas(), BorderLayout.LINE_END);

    pack();
    setVisible(true);
    setSize(800, 480);
  }