File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Drawing on desktopPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Drawing on desktopPane" Watch "Drawing on desktopPane" New topic
Author

Drawing on desktopPane

Mabel Ahmad
Greenhorn

Joined: Feb 03, 2006
Posts: 8
Hello everyone! This is my first time posting here at JavaRanch Big Moose Saloon, I hope I am doing it correctly.

I have a problem with my following code. I have created a background image witht the desktopPane and now I would like to draw some shapes over it, however I have no idea how to! Can someone please give me a few pointers and hints? Thank you very much for your help!

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632


Rectangle2D.Double(1, 1, 2, 2)
this will draw a very small red square, but will be underneath the title bar

change to this and see if it appears
Rectangle2D.Double(10, 35, 2, 2)
Mabel Ahmad
Greenhorn

Joined: Feb 03, 2006
Posts: 8
Oh whoops yes i changed the size now and it shows up in the cornner, however that is the only thing that shows up now and a white background. The background I had before is not showing up. Would anyone know why?

Thanks for your help!
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
just read your original post again, where you mention drawing shapes over the
image - this indicates you want the shapes on 'transparentPanel'.

if so, try this

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Drawing on desktopPane
 
Similar Threads
Glass panes -- transparent panes
Rotating an image
alpha filter of an element
how to put a background image with swing
Placing Jcombo at specific coordinates