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.
Just do System.out.println(e.getActionCommand()); inside actionPerformed(ActionEvent e) function. This will tell you which command is just performed.
System.out.println(e.getActionCommand());
actionPerformed(ActionEvent e)
or
if(e.getActionCommand().equals("Add")){ System.out.println("Add button pressed"); }