Yes.
Swing looks like it may have gotten easier to use but back in the day, I would make dedicated buttons and rely on my listeners and try catch blocks to make sure things got handles in the proper way. Lots of baby sitting in code but it always worked. That may be why I hate making UIs to this day though. It just ain’t pretty no matter what language you are using.