Hi all,
I am trying to draw some Java AWT 2D Graphics over a Jpeg ImageIcon which is
being used as a background for the GUI. The problem I have got is that the
ImageIcon is always in front of the 2D Graphics objects and I can not find a
way to make the graphics draw over the top of the background.
If anyone has any ideas how to get over this problem it will be greatly
appreciated.
Many thanks
Ed Keen
Ryan Stewart - 01 Feb 2004 23:47 GMT
> Hi all,
> I am trying to draw some Java AWT 2D Graphics over a Jpeg ImageIcon which is
[quoted text clipped - 8 lines]
>
> Ed Keen
Without seeing your code, who knows? (hint, hint) As a guess, I'd say you're
drawing your background after everything else. If that's the case, what else
do you expect? If you paint red circle on the wall and then paint the whole
wall blue, what's it going to look like?
Hobart Runa Sze - 05 Feb 2004 07:48 GMT
Are you using a Swing components with the image? It's tricky to mix awt
and Swing. They are not compatible in some ways. i.e. you can't add
swing components to container X and also draw in that container with awt.
Hobart
> Hi all,
> I am trying to draw some Java AWT 2D Graphics over a Jpeg ImageIcon which is
[quoted text clipped - 8 lines]
>
> Ed Keen
Hobart Runa Sze - 05 Feb 2004 07:52 GMT
There is a different manager for drawing Swing stuff and a different
manager for drawing awt. I think if you mix them, your Swing stuff will
be drawn on your screen after all your awt. Swamping every awt drawing
in the same container.
> Are you using a Swing components with the image? It's tricky to mix awt
> and Swing. They are not compatible in some ways. i.e. you can't add
> swing components to container X and also draw in that container with awt.
>
> Hobart