Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: The frame is decorated #2

Closed
computersarecool opened this issue Apr 23, 2014 · 6 comments

Comments

@computersarecool
Copy link

When trying to run the example I get the following:

Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: The frame is decorated
    at java.awt.Frame.setBackground(Frame.java:986)
    at com.onformative.screencapturer.Screen$2.run(Screen.java:115)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
ScreenCapturer: Width: 600 Height: 600 Proportion: 1.0

And the sketch does not work. Only a gray screen appears.

@clankill3r
Copy link

I have the same problem as well.
I want to fix the library tomorrow.

@muestra
Copy link

muestra commented Oct 18, 2014

Any help with this problem? I have it too!
thanks

@clankill3r
Copy link

I looked into it but there where more things not done really well.

You can run this without needing the library:

SimpleScreenCapture simpleScreenCapture;

void setup() {
size(600, 400);
simpleScreenCapture = new SimpleScreenCapture();

}

void draw() {

image(simpleScreenCapture.get(), 0, 0, width, height);

}


import java.awt.Robot;
import java.awt.Rectangle;
import java.awt.AWTException;

class SimpleScreenCapture {

Robot robot;

PImage screenshot;

SimpleScreenCapture() {
try {
robot = new Robot();
}
catch (AWTException e) {
println(e);
}
}

PImage get() {
screenshot = new PImage(robot.createScreenCapture(new Rectangle(0, 0, width, height)));
return screenshot;
}

}

@i-make-robots
Copy link

I can confirm this alternate method works. Can you suggest how to make the screen capture region moveable/sizeable? I'd really like those features.

@clankill3r
Copy link

That will be some more work. I suggest to look into the onformative/ScreenCapturer source code for that.

@joernroeder
Copy link

@clankill3r thanks for sharing this quick solution! 👍

alexr4 added a commit to alexr4/octaedrite that referenced this issue Nov 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants