summaryrefslogtreecommitdiff
path: root/altosuilib/AltosUIFrame.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-01-19 18:04:08 -0800
committerKeith Packard <keithp@keithp.com>2013-01-20 15:45:16 -0800
commit5d35fd843299b5ff09a36220e6ecd8aefceb9b2c (patch)
tree63fd35049955a4dd98588af122d14594c405caa9 /altosuilib/AltosUIFrame.java
parentaed990c3a37249a111c783336afade7ecdda7546 (diff)
altosui/micropeak: Let native window system place windows
Instead of forcing windows to our choice of positions, let the host window pick reasonable locations. This avoids having all of our windows appear on top of one another. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUIFrame.java')
-rw-r--r--altosuilib/AltosUIFrame.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/altosuilib/AltosUIFrame.java b/altosuilib/AltosUIFrame.java
index 409aea2e..8a1ba205 100644
--- a/altosuilib/AltosUIFrame.java
+++ b/altosuilib/AltosUIFrame.java
@@ -66,7 +66,19 @@ public class AltosUIFrame extends JFrame implements AltosUIListener {
setIconImages(icons);
}
+ private boolean location_by_platform = true;
+ public void setLocationByPlatform(boolean lbp) {
+ location_by_platform = lbp;
+ super.setLocationByPlatform(lbp);
+ }
+
+ public void setVisible (boolean visible) {
+ if (visible)
+ setLocationByPlatform(location_by_platform);
+ super.setVisible(visible);
+ }
+
public AltosUIFrame() {
AltosUIPreferences.register_ui_listener(this);
addWindowListener(new AltosUIFrameListener());