How can I check that JButton is pressed? If the isEnable() is not work?
问题 How can I check that JButton is pressed? I know that there is a method that its name is \"isEnabled\" So I try to write a code to test. this code have 2 Jbuttons which are \"Add\" Button and \"Checkout\" button. the code will show the \"Add button is pressed\" message when I press \"Checkout\" button after I press \"Add\" button but If the \"Add\" Button is not pressed before the \"Checkout\" Button is pressed, the code will show the \"Add Button is not pressed\" message. Here the code: final