We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › this.frame.setUndecorated(true);
Page Index Toggle Pages: 1
this.frame.setUndecorated(true); (Read 2562 times)
this.frame.setUndecorated(true);
Oct 18th, 2008, 3:12pm
 
hi,
this.frame.setUndecorated(true) even when called has the 1st statement of init() or setup() throws a

Exception in thread "Animation Thread" java.awt.IllegalComponentStateException: The frame is displayable.
at java.awt.Frame.setUndecorated(Unknown Source)

i think this is happening this 149+ or 150+.

any ideas to get around this ?
Re: this.frame.setUndecorated(true);
Reply #1 - Oct 19th, 2008, 7:40am
 
hi mots,
you may try the following. without warranty though since i havnt checked if it might cause any harm to a sketch. for now it worked for me.

Code:

import processing.opengl.*;

void setup() {
size(640,480,OPENGL);
// setting the location only worked
// for OPENGL and P3D though
frame.setLocation(0,0);
frameRate(50);
}

void draw() {
background(random(255));
}

public void init(){
// to make a frame not displayable, you can
// use frame.removeNotify()
frame.removeNotify();

frame.setUndecorated(true);

// addNotify, here i am not sure if you have
// to add notify again.
frame.addNotify();
super.init();
}

Re: this.frame.setUndecorated(true);
Reply #2 - Oct 19th, 2008, 9:53am
 
thanks andreas !

it did the trick Smiley
Re: this.frame.setUndecorated(true);
Reply #3 - Feb 24th, 2010, 6:08am
 
hi, i just came across this post.
is there an easy way to add the option of dragging the window arround on the screen?
Re: this.frame.setUndecorated(true);
Reply #4 - Feb 24th, 2010, 6:24am
 
got it, for those who are intersted,

int mX;
int mY;
void mousePressed(){
mX = mouseX;
mY = mouseY;
}
void mouseDragged(){

frame.setLocation(MouseInfo.getPointerInfo().getLocation().x-mX,MouseInfo.getPoi
nterInfo().getLocation().y-mY);
}
Re: this.frame.setUndecorated(true);
Reply #5 - Feb 24th, 2010, 7:08am
 
nice. for those who want to try:

Quote:
void setup() {
  size(400,400);
}

void draw() {}


int mX;
int mY;

void mousePressed(){
  mX = mouseX;
  mY = mouseY;
}

void mouseDragged(){
  frame.setLocation(
  MouseInfo.getPointerInfo().getLocation().x-mX,
  MouseInfo.getPointerInfo().getLocation().y-mY);
}

public void init(){
  frame.removeNotify();
  frame.setUndecorated(true);
  frame.addNotify();
  super.init();
}

Re: this.frame.setUndecorated(true);
Reply #6 - Feb 24th, 2010, 8:24am
 
thx for putting it together! i was just do busy/lazy atm Smiley
Page Index Toggle Pages: 1