title: How can I check that JButton is pressed? If the isEnable() is not work?
body: <p>How can I check that JButton is pressed? I know that there is a method that its name is "isEnabled"</p>
  
  <p>So I try to write a code to test.</p>
  
  <ol>
  <li>this code have 2 Jbuttons which are "Add" Button and "Checkout" button.  </li>
  <li>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.</li>
  </ol>
  
  <p>Here the code:</p>
  
  <pre><code>final JButton btnAdd = new JButton("Add");
  btnAdd.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
      }
  });
  panel.add(btnAdd);
  JButton btnConfirm = new JButton("Check Out");
  btnConfirm.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
          if (btnAdd.isEnabled()) {
              System.out.println("Add Button is pressed");
          }
          if (!btnAdd.isEnabled()) {
              System.out.println("Add Button is not pressed");
          }
      }
  });
  </code></pre>
  
  <p>When I run this code,the code give only the " Add button is pressed" although I didn't press the "Add" Button. Why does it occur like that? </p>