Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drawing on desktopPane

 
Mabel Ahmad
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic