示例#1
0
  public Teste() {
    super("colormatrix");

    caps = new GLCapabilities();
    canvas = new GLCanvas(caps);
    canvas.addGLEventListener(this);
    canvas.addKeyListener(this);

    add(canvas);
  }
 /**
  * UserInput constructor.
  *
  * <p>To make the new UserInput instance able to receive input, listeners need to be added to a
  * GLCanvas.
  *
  * @param canvas The GLCanvas to which to add the listeners.
  */
 public UserInput(GLCanvas canvas) {
   canvas.addMouseListener(this);
   canvas.addMouseMotionListener(this);
   canvas.addKeyListener(this);
 }