0

为什么我的 JWS 应用程序不响应 Swing 按钮操作?

我有一个在 Eclipse 中创建的程序。它收集有关连接到本地网络的设备的信息,并将其显示在JTable. 在环境中,它在 单击开始按钮之前 和之后执行良好

当尝试通过 Java Web Start (JWS) 启动它时,我按下 Swing Gui 上的按钮,它们没有执行我创建的操作方法。它什么也没做。这是之前之后

jar/jnlp 文件是最新的,并且正在本地启动。什么可能导致这种情况?我怎样才能调试这样的东西?

4

1 回答 1

2

When trying to launch it through Java Web Start (JWS),I press buttons on the Swing Gui and they do not perform the action method I created. It doesnt do anything.

As mentioned in java-web-start tag in StackOverflow

By default, an applet-like security sand-box is applied to code launched using JWS

While, In your code as you had said , You are collecting information about devices connected to a local network . But , since your code is running in applet-like security sand-box it is not allowing it to access the local network which usually is allowed when you running it as desktop application via eclipse . So, when the Start Test button is clicked your application might be throwing some kind of SecurityException which is not anticipated by you , hence consumed in the background.

UPDATE

To relax this sand-box the code needs to be digitally signed by the provider, and trusted by the end user

This means that To make Your Code to perform those tasks which it can't do, you need to have the jnlp/jar file which is digitally signed by the provider from where you have downloaded it , and also you must be able to verify that the file is received from that site only and was not modified.This is to ensure that you the receiver doesn't run some malicious code which could harm his local system. See the oracle tutorial on Lesson: API and Tools Use for Secure Code and File Exchanges. It says that:

If you electronically send someone an important document (or documents), or an applet or application to run, the recipient needs a way to verify that the document or code came from you and was not modified in transit (for example, by a malicious user intercepting it)

There are many more information available on that tutorial. Go through it.

于 2013-06-19T18:03:46.497 回答