Hi -

I'm a Win32 C++ developer, not sure how to do this one.

The point of my question is to auto-fill in a simple form written in Java.

I have a Java app, similar to the simple example below. On my Win32 patform, I can use a combination of FindWindow() and EnumChildWindows() to find a top-level window and enumerate its child windows. If the top-level window is a non-Java app, this is pretty simple. But I'm having problems with this Java app.

When I use the Spy++ tool, I can find the top-level window (which it reports is of class SunAwtFrame), but it cannot enumerate any child windows.

All I want is to be able to get the handle to the two text fields and stuff them with text.

My auto-fill app must run separate from the Java App.

Any ideas? I've searched the web for a good part of the morning and have been unable to find help.

Thanks for your time,
lizard43


import java.awt.*;
import javax.swing.*;

public class SimpleTest extends JFrame
{
public SimpleTest()
{
setSize(WIDTH, HEIGHT);
JTextField Name = new JTextField("name", 20);
JTextField Name2 = new JTextField("name2", 20);
getContentPane().add(Name, BorderLayout.NORTH);
getContentPane().add(Name2, BorderLayout.SOUTH);

}

public static final int WIDTH = 100;
public static final int HEIGHT = 100;

public static void main(String[] args)
{
SimpleTest frame = new SimpleTest();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
}
}