Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9224557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:21:09+00:00 2026-06-18T04:21:09+00:00

Is there a way of retrieving event info and UI element data from an

  • 0

Is there a way of retrieving event info and UI element data from an external Java desktop application? Specifically, I need to log when the value of a specific textbox changes and retrieve data from several other input elements.

This is for a proof-of-concept project for a customer (not malware;-)).

The Java application already exists and cannot be added to or re-compiled. The “listening” application can be built using .NET or Java. I’ve found some limited info on Windows event hooks and the Java Accessibility API but have hit a block, mainly due to my lack of knowledge.

I’ve no idea if this is easily done – thoughts appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:21:10+00:00Added an answer on June 18, 2026 at 4:21 am

    One solution that comes to my mind is to write a Java program that wraps the existing one.

    Let’s say the original program is distributed in a single .jar. Then, you would write a Java class, compiled with this jar as a dependency, run with this jar in the classpath, and containing a main function that calls the main function of the jar.

    public class WrapMyApp {
        public static void main(String[] args) {
            com.myorg.MyApp.main(args);
        }
    }
    

    So, using this technique, you are in control of the JVM, and can inject code before or after the call to main.

    What trick can you use to retrieve some infos from the GUI ? Well, if you are lucky, maybe you could try to access the GUI component through the reflexion API. Another solution is to traverse the GUI, starting from the JFrame. This implies that the GUI layout is known in advance, and that it’s static enough. Example :

        JWindow w = (JWindow) Window.getWindows()[0];
        JPanel p = (JPanel) w.getContentPane().getComponent(2);
        JTextArea t = (JTextArea) p.getComponent(5);
        String s = t.getText();
    

    You can use tools like SwingExplorer to explore the GUI layout, in order to discover where your components are located.

    If this doesn’t work, you can try to hook to the EventQueue, listening to the key events :

        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
    
            public void eventDispatched(AWTEvent event) {
                // useful code here
            }
        }, AWTEvent.KEY_EVENT_MASK);
    

    Don’t forget to wrap your code inside a SwingUtilities.invokeLater(), when trying to access GUI components.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there way how to get name ov event from Lambda expression like with
I'm stuck with retrieving data from a MySQL-database in an efficient way. I have
There's a fairly easy way of retrieving 15-minute delayed quotes off of Yahoo! Finance
Is there way to get file from windows xp command prompt? I tried to
Is there way that I can read the file from remote server using fopen
I need to find a way to efficiently process a large amount of data
Im trying to figure out a way to get some JSON data transfered from
Is there way to automatically maximize the output window on hitting build and then
Is there way to copy a file into Plone with WebDAV and have Plone
Is there way to better identify design pattern in source codes, esp. if you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.