Is this proper usage (and/or expectation) of a GlassPane?

Summing things up:

- I have a JFrame which contains a JPanel in its content pane

- I draw a grid in the JPanel in its paintComponent() method

I want to be able to draw over this grid without having to redraw the grid every time (this is mean for "line tool" type drawing, not freehand).

Is there anyway to use the setGlassPane method to achieve this?

I am picturing the glass pane component as a layer above everything else that can be drawn on without having to worry about (ie. redraw) whats under it. Is this a good assumption?

In my current implementation I have a glass pane set, although whenever i call glasspane.redraw() it ends up triggering a call to my jpanel.paintComponent() forcing me to redraw everything. Is there a way to avoid this and have some buffers automatically determine which pixels need to be redrawn under the glass?

Thanks

Message was edited by:

funkture

[945 byte] By [funkturea] at [2007-11-27 1:33:37]
# 1
/bumping.. anyone?
funkturea at 2007-7-12 0:39:50 > top of Java-index,Desktop,Core GUI APIs...
# 2
The word "glass" in glasspane means that in most cases, the glass pane is non-opaque. As such, when it's painted, it causes everything below it to be repainted.
kirillga at 2007-7-12 0:39:50 > top of Java-index,Desktop,Core GUI APIs...