简体   繁体   English

Install4j:窗口定位

[英]Install4j: window positioning

How do you position your installer window on the screen? 您如何在屏幕上放置安装程序窗口?

By default it is centered, which is fine in most cases. 默认情况下,它居中,在大多数情况下都可以。 However, I am running multiple mini-installers (all created by Install4j, but which can be ran as standalones) during the installation process, and all these installers stack themselves on the same portion of the screen. 但是,在安装过程中,我正在运行多个小型安装程序(全部由Install4j创建,但可以独立运行),所有这些安装程序都将自己堆叠在屏幕的同一部分。 As a result, it is very confusing for the end user, since they all have a "Finish" screen, and from their point of view there was only 1 window (or installer). 结果,对于最终用户来说,这非常令人困惑,因为他们都有一个“完成”屏幕,并且从他们的角度来看,只有一个窗口(或安装程序)。

I would like to do a little offset or something, but couldn't find any properties to achieve that, besides resizing the window (which is kind of a bad workaround) 我想做一些偏移或其他操作,但是除了调整窗口大小(找不到解决方法)之外,找不到任何属性来实现该目的。

You can set the "Post-activation" script of your first screen to 您可以将第一个屏幕的“激活后”脚本设置为

import java.awt.EventQueue;
EventQueue.invokeLater(new Runnable() {
    public void run() {
        Util.getParentWindow().setLocation(0, 0);
    }
});

to change the location of the installer window. 更改安装程序窗口的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM