From 3454592169dcb61b81de9af2b631b87e7dd86231 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 20 Jan 2013 15:42:05 -0800 Subject: altosui: Make initial AltOS window position configurable Give the user a choice of nine locations on the screen Signed-off-by: Keith Packard --- altosui/AltosUI.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index d630ceec..0efe27a0 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -224,14 +224,6 @@ public class AltosUI extends AltosUIFrame { doLayout(); validate(); - setVisible(true); - - Insets i = getInsets(); - Dimension ps = rootPane.getPreferredSize(); - ps.width += i.left + i.right; - ps.height += i.top + i.bottom; - setPreferredSize(ps); - setSize(ps); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override @@ -239,6 +231,11 @@ public class AltosUI extends AltosUIFrame { System.exit(0); } }); + + setLocationByPlatform(false); + + /* Insets aren't set before the window is visible */ + setVisible(true); } private void ConnectToDevice() { -- cgit v1.2.3