Manos Kounelakis Manos Kounelakis - 1 year ago 58
Java Question

Create a completely transparent JFrame

I have the following class

public class FileCopyManager extends JFrame{

public static final Color TRANSPARENT_COLOR = new Color(0,0,0,0);
public FileCopyManager(){
public static void main(String[] args) {
try {
catch (Throwable e) {
new FileCopyManager();

However when I try to run this program I get the following error:

Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: The frame is decorated
at java.awt.Frame.setBackground(Unknown Source)

Any Ideas why this is happening?

Answer Source

Well just use this.setUndecorated(true)