Back in 2013 there was a post (Problem with JavaAccessBridge doAccessibleActions method) regarding the doAccessibleActions method of the JavaAccessBridge. That post was locked a month later without so much as a comment stating the issue was even looked at.
Now it is 2025, and I am having the SAME issue. I get a Java window, and when I click the button (all working good to this point), a dialog (SunAwtDialog) appears. At this point the doAccessibleActions locks, timing out after 2 minutes. And a ReleaseJavaObject of the Java button that was clicked lock up without a time out until the dialog is answered. Problem is, I want my program to answer the dialog.
When the program is in this state, I have gone into JavaMonkey and done a refresh. This ALSO locks until the Dialog is replied to.
The interesting thing is that if I perform the sequence manually, get the dialog, and go to JavaMonkey to refresh. It shows all the open Java windows, including the dialog as it should.
Here is the portion of code I am using to call the doAccessibleActions method:
acCtrl = CJAB::GetControlAt (hWnd, 6, 87, vmID, ac); // Button
AccessibleActionsToDo actions;
jint err;
actions.actionsCount = 0;
while (actions.actionsCount < MAX\_ACTIONS\_TO\_DO && CJAB::ClickAction\[actions.actionsCount\] != nullptr)
{
wcscpy\_s(actions.actions\[actions.actionsCount\].name, SHORT\_STRING\_SIZE, CJAB::ClickAction\[actions.actionsCount\]);
actions.actionsCount++;
}
doAccessibleActions(vmID, acCtrl, &(actions), &err);
Where – CJAB::GetControlAt calculates the control location and issues :
GetAccessibleContextAt(vmID, acWnd, (jint)pScreen.x, (jint)pScreen.y, &acRet);
This works as the proper button is found and returned. It is used for other controls as well and always returns the proper AC.
And CJAB::ClickAction contains:
wchar\_t\* ClickAction\[2\] = { L"click", nullptr };
Could someone please help me. I would hope that in 12 years someone has found a solution to this problem outside of using Windows SendInput to close the dialog.
Thank you all……….