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>
/* Handle batch-mode */
if (args.length == 0) {
AltosUI altosui = new AltosUI();
- altosui.setVisible(true);
java.util.List<AltosDevice> devices = AltosUSBDevice.list(Altos.product_basestation);
for (AltosDevice device : devices)
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());
ps.height += i.top + i.bottom;
// setPreferredSize(ps);
setSize(ps);
- setLocationByPlatform(true);
setVisible(true);
}