简体   繁体   中英

How to modify an ActionEvent

I have a class that receives an Actionevent. I want to modify this event and add some objects to it (if that is possible). Kinda like how you do with Intents in Android. Is this possible or not?

To add some background:

The first class receives an actionEvent when a button is clicked, but I want this class to add a string value to the actionEvent and dispatch the event to another class acting as an actionlistener for this class. Is this possible or not? Would the dispatched event trigger an actionPerformed event?

I solved this by merging both classes into one which made it a lot easier by simply setting a variable and call a function to accomplish what I wanted. The other solution would have been to create a custom editable event and make both classes receivers of this event, but this is an assignment and I didn't have time to do that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM