Search:

Type: Posts; User: ICEPower

Search: Search took 0.07 seconds.

  1. Replies
    11
    Views
    1,868

    Re: addActionListener to JButton

    The only other class I've made is a JFrame to show a GUI, except that I haven't written any other program.
    I still don't understand why it doesn't recognize actionperformed for the Button but I...
  2. Replies
    11
    Views
    1,868

    Re: addActionListener to JButton

    I don't think I understand the problem, but I also don't really understand what you're saying about a program that shows the problem. I'm kind of really new to Java.
    Thank you for the help though!
  3. Replies
    11
    Views
    1,868

    Re: addActionListener to JButton

    When I click a button, suppose PLAY, it should print out "hello". It doesn't do that, so I think the THIS in knop.addActionListener(THIS) is for the ActionListener and is supposed to be written in...
  4. Replies
    11
    Views
    1,868

    Re: addActionListener to JButton

    If I modify the constructor like this (with JButton knop) the ActionListener works and does print "Hello" like it is written in the actionPerformed method.
    so from that I can see that the problem...
  5. Replies
    11
    Views
    1,868

    Re: addActionListener to JButton

    It doesnt give an error message, the ActionListener just doesn't work. When I click a button it does nothing..

    Thank you for your response!


    public class MainMenu extends JPanel implements...
  6. Replies
    11
    Views
    1,868

    addActionListener to JButton

    Hello,

    I'm trying to write a method that makes a JButton and adds actionlistener but it doesn't work.
    The code below is written in a Class that extends JPanel implements ActionListener.

    I...
Results 1 to 6 of 6