Make a JPanel not draw its background (Transparent)

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.


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.


This article seems to have some handy info on how to create shaped and transparent windows in Java:

https://docs.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html