Thanks dishmoth,
I was able to display the wireframe mode of image using gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE); Your suggestion was really helpful.
I have one more doubt. I am trying to switch between the wireframe mode and solid mode of the image on left and right mouse event click. But I am unable to switch between the two modes.
what I have did is set the value GL.GL_FILL on left click and GL.GL_FRONT_AND_BACK on right click for a variable which is passed as a first argument for the method
gl.glPolygonMode. And then I have called display() on the GLPanel which displays the image.
Please guide me where I am wrong.
Thanks in advance.