From 96c493f9325e0ec20bb8acd912897ae1937e3542 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Mon, 20 Feb 2012 00:26:13 +0000 Subject: [PATCH] adding canvas at the end of component list of frame --- java/libraries/opengl/src/processing/opengl/PGL.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/libraries/opengl/src/processing/opengl/PGL.java b/java/libraries/opengl/src/processing/opengl/PGL.java index 90708410e..c8ebec11e 100644 --- a/java/libraries/opengl/src/processing/opengl/PGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGL.java @@ -340,11 +340,11 @@ public class PGL { newtCanvas.setLocation(insets.left, insets.top); if (addCanvasToFrame) { - pg.parent.frame.add(newtCanvas); + pg.parent.frame.add(newtCanvas, pg.parent.frame.getComponentCount() - 1); pg.parent.frame.validate(); } else { // Framerate doesn't work, invalid drawable error (same for AWT). - pg.parent.add(newtCanvas); + pg.parent.add(newtCanvas, pg.parent.getComponentCount() - 1); pg.parent.validate(); } @@ -366,11 +366,11 @@ public class PGL { awtCanvas.setLocation(insets.left, insets.top); if (addCanvasToFrame) { - pg.parent.frame.add(awtCanvas); + pg.parent.frame.add(awtCanvas, pg.parent.frame.getComponentCount() - 1); pg.parent.frame.validate(); } else{ // Framerate doesn't work, invalid drawable error (same for NEWT). - pg.parent.add(awtCanvas); + pg.parent.add(awtCanvas, pg.parent.getComponentCount() - 1); pg.parent.validate(); }