java.swing and java.awt how to check if a button is activated or not?
<p>Basically     </p>

<pre><code>JButton.isEnabled() 
</code></pre>

<p>Is not working out for me. Once that the button is pressed I need a method to run and currently i cant check if the button is pressed or not. There were a lot of similar questions pertaining to this but none for the library i'm using or java at all, however if by chance I missed an answer please link it :) much appreciated
here is the code</p>

<pre><code>public class main_runner extends Frame {
private static encription_algorithm ea;
private static String password;
private static Scanner scan; 
public static JFrame f ;
static Container pane;
static JLabel dir;
static JPasswordField en;
static JTextField decr;
static JButton encrypt;


// get hash button doesnt work useless needs fix
public static void main(String[] args) {


    decr = new JTextField(30);
    dir = new JLabel("type in your message to encript it");
    f = new JFrame("encryptor");
    encrypt = new JButton("press to get hash");
    en = new JPasswordField(10);
    f.setSize(600,400);
    Color c = new Color(11,45,115);
    f.setBackground(c);
    f.add(dir);
    f.add(en);
    f.add(encrypt);
    if(encrypt.isEnabled() == true)
    {
        decr.setText(getHash());
        System.out.println("trigger");
    }
    else
        decr.setText("");

    f.add(decr);
</code></pre>

<p>to get into greater detail the trigger is printing out but the method is not running when i press the button</p>