making processingapplet run smoothly, properly destroy old ones (though no gc), proper file cleanup

This commit is contained in:
benfry
2001-07-29 18:30:08 +00:00
parent 60f986f0a3
commit 12eb70645d
3 changed files with 44 additions and 9 deletions

View File

@@ -52,15 +52,24 @@ implements ActionListener
e.printStackTrace();
System.exit(1);
}
int width = getInteger("width", 600);
int height = getInteger("height", 350);
int width = getInteger("window.width", 600);
int height = getInteger("window.height", 350);
// ms jdk requires that BorderLayout is set explicitly
frame.setLayout(new BorderLayout());
frame.add("Center", this);
init();
Insets insets = frame.getInsets();
frame.reshape(50, 50, width + insets.left + insets.right,
height + insets.top + insets.bottom);
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension screen = tk.getScreenSize();
int frameX = getInteger("window.x", (screen.width - width) / 2);
int frameY = getInteger("window.y", (screen.height - height) / 2);
frame.setBounds(frameX, frameY,
width + insets.left + insets.right,
height + insets.top + insets.bottom);
//frame.reshape(50, 50, width + insets.left + insets.right,
// height + insets.top + insets.bottom);
// i don't like this being here, but..
//((PdeEditor)environment).graphics.frame = frame;