posted 13 years ago
Hello, i am trying to make an application, where i can draw to an image, but i stucked.
My problem is:
A have an image and i need to write something in to with my tablet. But I need not to modify the image itself. And sometimes, i need to clear what i have written before, but also i do not need to modify the image. My idea was to write it to the GlassPane, which was over the JPanel, where the image was displayed. The problem is, when i need to erase the text a write(draw with my tablet) before, i remove the picture at the background too.
Here is the code, where i draw to the image:
currentAction:
The funtion reaint the parent is called everyTime the component need to be repainted.
And here is the code of the windows, where i am drawing(writing)
The Rewitable GlassPane is only update JPanel like this:
Can someone please give me some guide, how to to erase the things i drew before?
Lets assume a make a pencil(currentAction) and i need a eraser:))))
Sever: GlassFish v3
JSF 2.1
Mostly using NetBeans