Change Icon of the Frame inside code

I am trying to change the icon of the frame(window) through code. I need it because I require for the window to have a dynamic icon that shows its state at any point of time. I checked out this discussion but none of the solutions worked for me.
I also tried this:

final String ICON  = "sketch.jpg";//the image I want to use as icon

void setup(){
  size(500, 400);
  frame.setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(ICON));
}

//rest of code here

I want to know if this is possible in Processing 3.0, and if so, how. Any help is highly appreciated.
P.S. My computer runs Windows 8.1.

Answers

Sign In or Register to comment.