-
December 7th, 2012, 08:37 AM
#1
JPanel as a background for another JPanel
Hey Codegurus,
I want to draw some lines in a JPanel and then put another JPanel on top of it with another set of lines. I'd like to do this because i don't want to repaint the grid of lines every time im done making a graph.
Is there an easy way to go about doing this?
Thanks in advance!
-
December 7th, 2012, 10:41 AM
#2
Re: JPanel as a background for another JPanel
You can either add both the JPanels to the container panel and set their Z order to have one display over the other or you can set the lower JPanel's layout manager to BorderLayout and add the upper JPanel to it's center position. In either case you will also have to set the upper panel to transparent using setOpaque(false) so the lower panel shows through it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|