"The frame is decorated" error message

edited January 2017 in Library Questions

Hello,

I am using processing 2.2.1, when I try and run an example script, the following error message is appearing:

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)

I have tried adding

  frame.removeNotify();
  frame.setUndecorated(true);
  frame.addNotify();   

to the set up but with no luck.

Hopefully someone can point me in the right direction.

Thanks!

Answers

  • Does that happen with all example scripts? Maybe the screen capture frame is the culprit.

  • Got this old example working in Processing 2.2.1: >-)

    /** 
     * setUndecorated (v4.41)
     * by  rbrauer (2013/Jul)
     * mod GoToLoop (2013/Dec)
     * 
     * forum.processing.org/one/topic/
     * setundecorated-conflic-with-loadlont
     *
     * forum.processing.org/two/discussion/2018/
     * remove-decoration-window-under-p3d
     */
    
    void setup() {
      size(400, 320, removeFrameBorder(P3D));
    
      frameRate(60);
      smooth(8);
      stroke(#00FFFF);
      strokeWeight(1.5);
      textSize(32);
    }
    
    void draw() {
      background(0300);
    
      fill(#FF0000);
      text(frameCount, width - 100, 40);
    
      fill(#0000FF);
      translate(frameCount % width, height >> 1);
      sphere(0150);
    }
    
    String removeFrameBorder(String gfx) {
      if (!isGL()) {
        frame.removeNotify();
        frame.setUndecorated(true);
        frame.addNotify();
      }
    
      return gfx;
    }
    
  • Hi, no it only happens when using examples from the screenCapturer lib (http://www.onformative.com/lab/screencapturer/) I assume this was built for a previous version of processing / java. I'll give that a go ^ Thanks

  • Hi, just played around with that but still no luck, I think it has something to do with the fact that it is not opening a translucent window like it should. The script for the sketch is:

    import com.onformative.screencapturer.*;
    
    ScreenCapturer capturer;
    void setup() {
      size(600, 600);
      capturer = new ScreenCapturer(width, height, 30);
    }
    
    void draw() {
      image(capturer.getImage(), 0, 0);
    }
    

    I thought about using the following but was unable to get a result

    import com.sun.awt.AWTUtilities;
    
    void setup() {
      size(500,500);
      frame.removeNotify();
      frame.setUndecorated(true);
      AWTUtilities.setWindowOpacity(frame,0.5f);
      frame.addNotify();
    }
    

    Thanks again.

Sign In or Register to comment.