OpenGL draw partial object in scrollable panel
If you just want to prevent drawing pixels that are outside of a rectangular region (and I think that's what you're asking), than glScissor
is exactly what you're looking for.
In lwjgl, you can find the function in org.lwjgl.opengl.GL11
.