Search:

Type: Posts; User: Cornix

Search: Search took 0.09 seconds.

  1. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    no, dont use static, and dont make it a member variable either. you just declare them is final within your method. The same method you have been using already.
    This means that you can not use the...
  2. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    Make it known. If you dont want to make it a private member variable you can also declare it as "final".
  3. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    Perhaps you should read up on anonymous classes.
  4. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    Well, this was your question:

    So the answer is pretty simple: Nothing happens because you never told the button what to do when it is being clicked.

    As far as I know there are 2 ways to define...
  5. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    And where do you tell the button that it is supposed to execute these lines?
  6. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    No you dont.
    This is "before the last 2 lines":

    JButton button = new JButton("OK");
    pane.add(button);
    button.setBounds(120,120,40,20);
    And you dont tell the button anything here. Just because...
  7. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    At what point in your code do you tell the button what to do when it is clicked?
Results 1 to 7 of 7