Is it possible, in Java, to make a JPanel
skip drawing its background thus being transparent except for the components on it?
views:
2584answers:
3
+5
A:
setOpaque(false)
It'll pass off painting the background to its parent, which may draw its own background.
You can do a screen capture and then use that to paint the background of the panel.
Allain Lalonde
2008-09-10 18:19:21
I knew it would be simple. Thanks!
jjnguy
2008-09-10 18:23:06
+2
A:
This article seems to have some handy info on how to create shaped and transparent windows in Java:
http://today.java.net/pub/a/today/2008/03/18/translucent-and-shaped-swing-windows.html
Outlaw Programmer
2008-09-10 18:22:47
+1
A:
Technically a JPanel may start off non-opague. This was true for the Gtk look & feel in 1.5 (or 1.4?), but no other PL&Fs as far as I am aware.
Tom Hawtin - tackline
2008-09-11 12:46:34