Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2004

Tip: Looking for answers? Try searching our database.

Drawing 2D Graphics over an Image

Thread view: 
epbk2 - 01 Feb 2004 18:54 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.