This content has been marked as final. Show 6 replies
Console applications do not have Java owned windows. Nor is there anything for Java to support with regard to accessibility for console programs. Your screen reader or other program needs to work with the console (or shell) program which is typically not a Java program (for example cmd.exe on Windows).
mKorbel wrote:It did not help. I tried every function of that list, with and without creating a window before calls them:
Window w = Window.getOwnerlessWindows();
Output without creating window, but with running java-applet, that can be detected with Monkey:
Frame frames = Frame.getFrames(); System.out.println("frames.length = " + frames.length); Window OwnerlessWndsF = Frame.getOwnerlessWindows(); System.out.println("OwnerlessWndsF.length = " + OwnerlessWndsF.length); Window WndsF = Frame.getWindows(); System.out.println("WndsF.length = " + WndsF.length); Window OwnerlessWndsD = Dialog.getOwnerlessWindows(); System.out.println("OwnerlessWndsD.length = " + OwnerlessWndsD.length); Window WndsD = Dialog.getWindows(); System.out.println("WndsD.length = " + WndsD.length); Window OwnerlessWndsW = Window.getOwnerlessWindows(); System.out.println("OwnerlessWndsW.length = " + OwnerlessWndsW.length); Window WndsW = Window.getWindows(); System.out.println("WndsW.length = " + WndsW.length);
And output with creating window and running java-applet:
frames.length = 0 OwnerlessWndsF.length = 0 WndsF.length = 0 OwnerlessWndsD.length = 0 WndsD.length = 0 OwnerlessWndsW.length = 0 WndsW.length = 0
Only my window have been detected...
frames.length = 0 OwnerlessWndsF.length = 1 WndsF.length = 1 OwnerlessWndsD.length = 1 WndsD.length = 1 OwnerlessWndsW.length = 1 WndsW.length = 1
Edited by: user13805108 on 22.04.2011 3:34
I tried to call this functions in Java applications with dialog interface. They work there similar like in console that creates window for example like that
But I need to get the list of all top-level windows, that belong to current JVM.
Window W = new Window(null); W.setSize(new Dimension(100, 200)); W.setVisible(true);
This what I read in specification of getTopLevelWindows() function:
Why it does not work just this way?
getTopLevelWindows public static java.awt.Window getTopLevelWindows() Return the list of top level Windows in use in the Java Virtual Machine.
Edited by: user13805108 on 22.04.2011 5:53
I wrote that I tried to call this functions in Java applications with dialog interface. I mean - "Java Desktop Application" created in Netbeans. As far as I know that is not a console application.
If I'm wrong, then tell me please how to create an application in which EventQueueMonitor.getTopLevetWindows (or an analog of the function) will work properly