Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JLayeredPane  RSS feed

 
rob armstrong
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wondering if this is the best class for me to use?
1. Want a Jpg in background with JMenuBar on top
2. Want to draw lines on top of jpg pic.
3. Want ScrollPane to work cause the pic will be bigger than the size of the window.

Thanks
roba
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perhaps this way

the JMenubar is set via setJMenuBar

sub-class JPanel #1, giving it a preferredSize(), setting it as a BorderLayout,
and in paintComponent() you draw the image.

another sub-classed JPanel #2, setOpaque(false), and in paintComponent()
you draw your lines

add #2 to #1, add #1 to the scrollpane, add the scrollpane to the frame
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!