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

Removing background from JPanel  RSS feed

 
Jesse Miller
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a second JPanel (Panel 2) that I am placing over another main JPanel (Panel 1). On the second panel I am adding another re-sizable panel (Panel 3). I am defining Panel 2 as JPanel Panel2 = new JPanel(null); I would like the background of Panel 2 to be transparent so I can see the content of Panel 1. I have tried Panel2.setOpaque(false) but this still doesnt make the background transparent. And suggestions on what is different? What exactly does JPanel(null) do? Thanks

 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To increase your chances of getting help you should create a SSCCE that demonstrates the incorrect behaviour.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!