CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    Join Date
    Sep 2011
    Location
    IN
    Posts
    16

    Thumbs up Re: Help with ActionListener?

    Quote Originally Posted by Norm View Post
    Go to this site and read about how Action Listeners:
    http://download.oracle.com/javase/tu...nlistener.html

    Then change your simple program as per the tutorial.
    Good example for action listener from oracle... Nice one...

  2. #17
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Help with ActionListener?

    You said to put the .addActionListener(this) line into the constructor, but when I do that the line is highlighted because the constructor doesn't implement ActionListener,
    Sorry my mistake, the line

    Add the AnswerBox.addActionListener(this); line to the line after the line which assigns a JTextField to AnswerBox.

    Should have said:

    Add the AnswerBox.addActionListener(new keyEvents()); line to the line after the line which assigns a JTextField to AnswerBox.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured