如何通过单击 Windows 上的图标来运行 Java 程序? [英] How to run Java programs by clicking on their icon on Windows?

查看:14
本文介绍了如何通过单击 Windows 上的图标来运行 Java 程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个使用 Java swing 库的 Java 程序.现在我想通过双击 Windows 上的可执行文件来执行这个程序,就像任何其他带有 GUI 的程序一样.我怎么做?

解决方案

由于它是基于 Java 的并且具有 GUI,显而易见的答案是使用 & Star Zoom Animation)是两个基于 Java 的应用程序,使用 Java Web Start 安装.由于 JotPad 是沙盒化的,因此将提示用户是否创建快捷方式.该选项不适用于应用程序.具有更高的权限级别,因此使用 IntegrationService - 允许应用.(提示用户后)在运行时创建/删除它们.

I have written a Java program that uses Java swing library. Now I would like to execute this program by double clicking on the executable file on Windows just like any other program with a GUI. How do I do that?

解决方案

Since it is Java based and has a GUI, the obvious answer is to deploy it using Java Web Start.

Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation for platforms that support Java.

JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..

By 'desktop integration' read desktop shortcuts and menu items on supported platforms.

The 2 icons on the right (JotPad & Star Zoom Animation) are both Java based apps., installed using Java Web Start. Since JotPad is sand-boxed, the user will be prompted as to whether to create the shortcut. That choice is not offered for apps. with higher permission levels, so it would make more sense to install/remove the shortcuts and menu items using the IntegrationService - which allows an app. (after prompting the user) to create/remove them at run-time.

这篇关于如何通过单击 Windows 上的图标来运行 Java 程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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