How to press JButtons from within the program?
posted 7 years ago
My applet will have multiple buttons. When some of the buttons (B,C,&D) are pressed by the user, I would like the code that is executed then to include automatically pressing another button (button A). I wish that JButton had a method pressButton() that I could call from within the program. Of course I could just copy and paste all the code that happens when button A is pressed into buttons B C and D, but I was wondering if there is a less messy way to do this.