gpt4 book ai didi

java - JWS 应用程序不响应 Swing 按钮操作

转载 作者:行者123 更新时间:2023-12-02 06:57:00 25 4
gpt4 key购买 nike

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

我有一个在 Eclipse 中创建的程序。它收集有关连接到本地网络的设备的信息并将其显示在 JTable 中。在环境中它执行得很好 beforeafter the start button is clicked

当尝试通过 Java Web Start (JWS) 启动它时,我按下 Swing Gui 上的按钮,但它们不执行我创建的操作方法。它没有任何作用。这是beforeafter

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

最佳答案

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.

java-web-start 中所述StackOverflow 中的标签

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

同时,正如您所说,在您的代码中,您正在收集有关连接到本地网络的设备的信息。但是,由于您的代码在类似小程序的安全沙箱中运行,因此它不允许它访问本地网络,而当您通过 eclipse 将其作为桌面应用程序运行时通常允许访问本地网络。因此,当单击“开始测试”按钮时,您的应用程序可能会抛出某种您未预料到的“SecurityException”,因此会在后台消耗。

更新

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

这意味着要使您的代码执行它无法执行的任务,您需要拥有由您下载该文件的提供商进行数字签名的 jnlp/jar 文件,并且您必须能够验证该文件仅从该站点接收并且未被修改。这是为了确保接收者不会运行一些可能损害其本地系统的恶意代码。参见Lesson: API and Tools Use for Secure Code and File Exchanges上的oracle教程。它说:

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)

有关该教程的更多信息。通过它。

关于java - JWS 应用程序不响应 Swing 按钮操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17197384/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com