Loading...
Logo
Processing Forum
Hi, 

I try to resize my applet at runtime. I can call say size(800, 800) < do something> then size(400, 400) and it works flawlessly. 
But when I try to resize it to screen size, I can't resize back again. 
So after calling size(screenWidth, screenHeight) <do something> size(400, 400) the window size is still screenWdith, screenHeight. 
The same behaviour occurs, when i call frame.setSize(screenWidth, screenHeight) and try to downsize it again. 

Does somebody know what to do? 

regards

Replies(1)

I got the following example to work as expected:

Copy code
  1. void setup() {
  2.   size(400, 400);
  3. }

  4. void draw() {
  5.  
  6. }

  7. void mousePressed() {
  8.   if(mouseX > width / 2) {
  9.     reSize(400, 400);
  10.   } else {
  11.     reSize(screenWidth, screenHeight);
  12.   }
  13. }

  14. void reSize(int x, int y) {
  15.   frame.setSize(x, y);
  16.   size(x, y);
  17.  
  18.   frame.setLocation(0, 0);
  19. }