java小程序参数覆盖
我开发了一个带有 JLabels 的地图小程序。 JLabels 从小程序参数文件中获取其 X/Y 坐标值,以便在地图上显示准确的位置。
问题是:
地图小程序通常在大液晶显示屏上运行,但有些客户也希望在浏览器中查看地图。问题在于,小程序正在从服务器加载到客户端的浏览器,并且它应该始终连接到服务器,以便它们无法在本地运行小程序。在这种情况下,X/Y 坐标在地图上稍微移动。
一种解决方案可能是创建两个版本的小程序——一种用于 LCD,另一种用于客户端计算机。但是是否有任何选项可以为客户端使用本地参数文件?
I have developed a map applet that has JLabels on it. The JLabels get their X/Y coordinate values from an applet parameter file in order to be shown on the map in an exact position.
The problem is:
The map applet normally runs on a big LCD screen but some clients want to view the map in their browsers too. The issue with this is that the applet is being loaded from a server to the client's browser and it should always connect to the server so they can't run the applet locally. In this case, X/Y coordinates shift a little bit on map.
One solution may be to create two versions of the applet -- one for the LCD and one for client computers. But is there any option to use local parameter file for clients?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,您可以通过编程方式确定显示类型。因此,您只需向小程序传递 4 个参数,而不是 2 个 - x、y、xLcd、yLcd,并使用适当的参数(在小程序中使用简单的 if 语句)。
但最好尝试分析导致这种转变的原因,因为它从一开始就不应该发生。或者提出一个问题(提供更多细节)——为什么会发生这种转变。
As far as I understand, you can determine the type of display programatically. So you can just pass 4 parameters to the applet instead of 2 - x, y, xLcd, yLcd, and use the appropriate ones (with a simple if-statement in the applet).
But better try to analyze what causes that shift, because it should not happen in the first place. Or ask a question (giving more details) - why is the shift happening.