Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Identifying and Firing events programmatically

nikhil_shravaneOct 27 2009 — edited Dec 16 2009
Hi,

Scenario: I am maintaining a hashtable of all the components on my JFrame application as a value, and their respective area objects as a key. This application will be running in the background, and so user will not directly interact with this application. On other hand an image of my JFrame is shown to the user in the J2D and user will be interacting with that image. User will be moving over or clicking on an image in the J2D, and these X and Y points are sent to the application.
On receiving X and Y points, my JFrame application finds the appropriate component.

At present I am firing mouse event on JButton and I am sure that an event is successfully getting fired on the JButton programmatically as I can see the system outs in the JButtonMouseClicked() method in the listener.

Now, I want to generate and fire various events programmatically on the JFrame, so the the changes will occur on the JFrame to produce visual effects like pressing JButton, check-uncheck on JCheckBox, select-deselect JRadioButton or displaying dropdown list on JCombobox etc.

The components on the JFrame are not showing any changes mentioned above when mouse event occurred.

So please provide me the guidance if anyone having idea about this.

Thanks and Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2010
Added on Oct 27 2009
10 comments
860 views