【问题标题】:Swing: How can I display a Splash Screen before the main class? [duplicate]Swing:如何在主课前显示启动画面? [复制]
【发布时间】:2015-05-25 07:15:20
【问题描述】:

我创建了一个启动屏幕类,它基本上加载并运行 GIF 标题文件几秒钟。我怎样才能在主课之前显示这个?

public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            accountGUI inst = new accountGUI();
            inst.setLocationRelativeTo(null);
            inst.setVisible(true);

        }
    });
}

public accountGUI() {...

【问题讨论】:

标签: java swing splash-screen


【解决方案1】:

在您的主类中,在第一行添加对初始屏幕的调用。这样它就会运行启动画面,然后在主类中运行你需要的东西。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-11
    相关资源
    最近更新 更多