How to copy text from Java program?

I am using a Java program called JDownloader v0.9.581 and I wish to copy the full file and link list from main scrolling window. JDownloader has no way to save the full list as a text file.

I have already tried using all programs from Is there any way a user can view or copy non-editable GUI controls' contents at runtime? and Read the contents of a ComboBox (or any other windows control), and also many other programs from a Google search such as GetWindowText. But nothing lets me copy full text from a Java program like this.

One suggestion I've received was to do a PrintScreen and OCR the results, but that isn't a workable/scalable solution. How I can copy full text from JDownloader?


Solution 1:

Java programs are different because instead of using native controls, they custom paint the entire UI. (This is the case with the default UI toolkit known as Swing; other toolkits like SWT do use native controls, and the less said about the ancient AWT the better.) Sometimes they try to mimic the native platform, and other times they have their own look&feel. In any case, Windows-specific grabbers don't work because all they see is a single window with a bunch of pixels.

You can try installing the Java Access Bridge, which is intended for accessibility. Instead of just pixels, it makes the text content of the Java controls available to the OS, for assistive technologies like screen readers. That might make the native grabbers work. Or you can run the included JavaMonkey program:

  1. choose File | Refresh Tree on the main menu
  2. drill down the component hierarchy to find the main window (look for things like [panel] and [viewport])
  3. right-click, or from the Panels menu
  4. choose Display Accessibility Information

Depending on exactly how your particular app is structured, that may include all the visible text in the control, although the formatting and organization might not be ideal.