GLCanvas canvas1 = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
GLCanvas canvas1 = new GLCanvas();
  public void run(String[] args) {    GLCanvas canvas1 = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());    canvas1.addGLEventListener(new Listener());    canvas1.setSize(256, 256);    Frame frame1 = new Frame("Canvas 1");    frame1.setLayout(new BorderLayout());    frame1.add(canvas1, BorderLayout.CENTER);    GLCanvas canvas2 = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities(), null, canvas1.getContext(), null);    canvas2.addGLEventListener(new Listener());    canvas2.setSize(256, 256);    Frame frame2 = new Frame("Canvas 2");    frame2.setLayout(new BorderLayout());    frame2.add(canvas2, BorderLayout.CENTER);    Random random = new Random(System.currentTimeMillis());    Frame frame;    if (random.nextBoolean()) {      frame = frame1;      delayedFrame = frame2;    } else {      frame = frame2;      delayedFrame = frame1;    }    System.err.println("Showing first frame");    frame.pack();    frame.show();    new Thread(new Runnable() {        public void run() {          try {            Thread.sleep(1000);          } catch (InterruptedException e) {          }          System.err.println("Showing other frame");          delayedFrame.pack();          delayedFrame.show();          delayedFrame.setLocation(256, 0);        }      }).start();  }