我们如何检查javaFx应用程序是否已在运行? [英] How can we check that javaFx application is already running?

查看:256
本文介绍了我们如何检查javaFx应用程序是否已在运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有什么方法可以检查我们的javaFx应用程序是否已经运行。如果是,则显示现有的应用程序实例,否则启动一个新实例。

Is there any way that we can check if our javaFx application is already running. If yes then show the existing instance of application otherwise launch a new instance.

推荐答案

我确信可能有更好的解决方案在那里,但是当我遇到这个问题时,我刚刚制作了一个布尔值,一旦运行了start方法就会改变它,默认为false。

Well I am sure there is probably a better solution out there, but when I encountered the issue I just made a boolean that would be changed once the start method was ran having it false as default.

这篇关于我们如何检查javaFx应用程序是否已在运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆