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 › Resizing windows with the mouse: how
Page Index Toggle Pages: 1
Resizing windows with the mouse: how? (Read 686 times)
Resizing windows with the mouse: how?
Jan 2nd, 2008, 1:12pm
 
Hey,

I want my stand-alone processing program to have the ability of being resized by the mouse.

I now used this code:

void resize(int w, int h)
{ super.resize(w,h);
 frame.setSize(w,h);
}

And this works fine for resizing, but it doesn't make the edges of the window react to mouse input (clicking and dragging to modify the window size). Can this be done?

Thanks - Tarik
Re: Resizing windows with the mouse: how?
Reply #1 - Jan 10th, 2008, 11:09am
 
So NOBODY knows how to make a stand-alone processing window resizable with the mouse? Is processing an inherently non-window-resizable-by-mouse-except-for-in-browsers language? I find this very hard to believe... but if this is true, would somebody please be so kind as to confirm this fact?

Thanks - Tarik
Re: Resizing windows with the mouse: how?
Reply #2 - Jan 10th, 2008, 12:14pm
 
syntax is : frame.setResizable(true);

Code:
void setup() {
frame.setResizable(true);
}

void draw() {
background(255);
rect(10, 10, width-20, height-20);
}
Re: Resizing windows with the mouse: how?
Reply #3 - Jan 10th, 2008, 1:30pm
 
Wow... so apparently that was why nobody was answering: my question was just too stupid! Strange thing is: I really spent a lot of time finding the answer to this question.

Well, thanks a lot!
Re: Resizing windows with the mouse: how?
Reply #4 - Jan 10th, 2008, 8:11pm
 
I'm not sure that's the reason. I think most people don't need to resize their PApplets so they don't need to know how to. And what's more, the trick is not documented.

If you don't have any previous Java experience, it's not so easy to find out the answer on your own, but when it's dealing with such issues, try browsing the developer's reference (reference > advanced > developer's reference).
How to resize window?
Reply #5 - Apr 25th, 2008, 8:57am
 
Hi,
I've looked at this and some other threads but I simply can't figure out how to resize the window?

The thing is, I am using processing to analyze a movie file first, (which is grabbing pixels), then resize the window once to draw a higher resolution image.

Whenever I try to use size or resize etc, I get this error:

java.lang.RuntimeException: new renderer
at processing.core.PApplet.size(PApplet.java:1026)
at processing.core.PApplet.size(PApplet.java:933)
at Temporary_7277_6083.draw(Temporary_7277_6083.java:124)

java.lang.RuntimeException: new renderer
at processing.core.PApplet.size(PApplet.java:1026)
at processing.core.PApplet.handleDisplay(PApplet.java:1459)
at processing.core.PGraphics.requestDisplay(PGraphics.java:690)
at processing.core.PApplet.run(PApplet.java:1556)
at java.lang.Thread.run(Thread.java:613)

at processing.core.PApplet.size(PApplet.java:933)
at Temporary_7277_6083.draw(Temporary_7277_6083.java:124)
at processing.core.PApplet.handleDisplay(PApplet.java:1459)
at processing.core.PGraphics.requestDisplay(PGraphics.java:690)
at processing.core.PApplet.run(PApplet.java:1556)
at java.lang.Thread.run(Thread.java:613)

Page Index Toggle Pages: 1