2

I have below scenario and I am stuck at one place. Can anyone please help me on this?

I have a applet application which is deployed on server1 and I am accessing this applet on client1. When I click on the any specific tab of JTabbedPane, request goes to server and it downloads specific classes which are required to load. When I click on any of the tab using Mouse everything works fine. When I do the same thing programmatically (dispatching MouseEvent or using setSelectedIndex() method of JTabbedPane), it doesnt work.

Note: My code of dispatching event is not on the same domain, I have this code locally only, Please read below for how I am dispatching the event.

I have created a java agent MyAgent.jar which includes a function to click on tab to select particular tab (JTabbedPane).

My java agent (instrumentation agent) is on client1 and while running applet I am attaching my java agent with applet and this agent dispatches mouse click event. In this scenario, tab gets selected but it throws ClassNotFoundException and no components gets loaded in this tab because of the exception.

Anyone faced similar kind of issues or anyone aware of anything to tryout, please let me know.

4

2 回答 2

2

MouseListener您应该附加ChangeListener到选择模型,而不是使用 a来监视对选项卡状态的更改。

这样,如何更改选项卡就无关紧要了。

于 2013-06-17T04:34:29.220 回答
1

问题已经解决了。javaAgent 的 securityContext 不同,applet 的 securityContext 也不同。因此 javaAgent 无法加载小程序上下文中存在的类。现在我进行了更改,以便我的代码也可以在小程序上下文中运行。现在,当事件被触发时,它可以加载所需的类。

于 2013-11-15T11:07:41.887 回答