The most important piece of code is turning on blending.
gl.glEnd();One thing you must note here is that the texture binding is done outside the glBegin and glEnd calls as well as telling the device to turn on blending and setting the blend function.
// Really basic and most common alpha blend function
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
tpTexture.bind();
gl.glBegin(GL.GL_QUADS); // the gl draw mode
Other code to note is the creation of a texture from a BufferedImage, which is covered in a previous post so take a look at that first, Drawing HTML with JOGL Part 1: Textures. This example is based off of that code.
NOTE: Also, be sure to pay close attention to the order in which transparent textures are drawn.
And now the code:
This example uses JOGL version 1.1.1a and should work with the NetBeans plugin you can obtain the version from JOGL's website go to the "Archived Builds" page from the navigation menu on the left. Then find the jsr-231-1.1.1a folder