The wonders of open source ... . I just got this random email. If someone
wants to toy with this (fixing bug #522691), feel free. (Before you start
working on it, assign the bug to yourself.
-brian
---------- Forwarded message ----------
Date: Tue, 26 Feb 2002 22:37:40 -0800
From: Etan <za...@no...>
To: bs...@bs...
Subject: Quick MainFrame window position fix
Just a quick fix for centering the DrJava window on start
up.
Use this in your MainFrame.java:
this.setSize(new Dimension(800, 700)); // use your globals
Dimension screenSize = Toolkit.getDefaultToolkit
().getScreenSize();
Dimension frameSize = this.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
this.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
//////////////////////////
Then You'll have a nice centered screen every time.
email me!
za...@no...
|