Linux - Java 应用程序的启动屏幕
在 Windows 上,我使用 Exe4J 来启动我的 Java 应用程序。这具有以下优点:
- 在 Java 启动之前显示的启动屏幕
- 可以在启动期间更新启动屏幕上的标签,直到应用程序完全加载(“初始化通量补偿器”、“重新排序高半字节”等)
现在我想要在 Linux 上实现这一点。我使用 Shell 脚本启动我的应用程序,但希望有一种简单的方法来显示某种带有标签的启动 GUI,我可以在启动期间从我的 shell 脚本进行更新。
有没有一种简单的方法可以从 shell 脚本启动最小的 GUI,并从 shell 脚本更新其中的标签,而无需为 Linux(甚至可能是 Mac OS X)编译单独的可执行文件?
PS:我不想在启动屏幕中使用 Java 构建,因为标签必须动态更新。
On Windows I use Exe4J to start my Java Application. This has the following advantages:
- Splashscreen which shows before Java starts
- Possibility to update a Label on the splash screen during the startup, until the application is folly loaded ("Initializing Flux compensator","Reordering high nibbles", etc.)
Now I want to implement this on Linux. I start my App with a Shell script, but would love an easy way to show some kind of splash GUI with a label on it, which I can update from my shell script during startup.
Is there an easy way to fire up a minimal GUI from a shell script, and to update the label in it from the shell script, without having to compile a separate executable for it for linux (and maybe even Mac OS X)?
PS: I don't want to use the Java build in splash screen because of the Label which has to be updated dynamically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
屏幕启动的标准 Java 1.6+ 解决方案支持在启动上自定义绘图 Screensplash教程。
这是一个启动控制器的示例,它有一个主要方法——使用启动参数运行它以查看结果。
The standard Java 1.6+ solution for screen splash does support custom drawing on the splash Screensplash Tutorial.
Here is an example for a splash controller, which has a main method -- run it with a splash parameter to see the result.
Eclipse 启动器在所有平台上都支持此功能,但是转向 SWT 可能太过分了? 此处有详细信息。
The Eclipse launcher supports this functionality on all platforms, but moving to SWT may be going too far? There are details here.
您可以在脚本中使用 Python(或其他一些公开 GUI 功能的脚本语言)。
http://docs.python.org/faq/gui.html
You could use Python (or some other scripting language that exposes GUI functionality) from your script.
http://docs.python.org/faq/gui.html