Results 1 to 3 of 3
  1. #1
    Jib
    Jib is offline Member
    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    Default Simple question about "actionPerformed"

    Hello everyone!

    Does anyone knows what this code does?

    Java Code:
    public void actionPerformed(ActionEvent e) {
    		
    }
    Generally, what actionPerformed does? I watched a tutorial and I used it for my game loop but I have no idea what it's doing

    Can someone help me

    Thanks

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,734
    Blog Entries
    7
    Rep Power
    21

    Default Re: Simple question about "actionPerformed"

    A lot of Swing components (e.g. JButtons) send an ActionEvent to their ActionListeners when a certain 'action' has happened (e.g. a button was pressed). In the actionPerformed( ... ) method of your ActiionListener you do what you have to do when such an action has happened. Read the API documentation; it's all in there ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Jib
    Jib is offline Member
    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    Default Re: Simple question about "actionPerformed"

    Quote Originally Posted by JosAH View Post
    A lot of Swing components (e.g. JButtons) send an ActionEvent to their ActionListeners when a certain 'action' has happened (e.g. a button was pressed). In the actionPerformed( ... ) method of your ActiionListener you do what you have to do when such an action has happened. Read the API documentation; it's all in there ...

    kind regards,

    Jos
    Thanks for the reply. The reason I'm not using API documentation is that they are explaining with certain way that I can't barely understand what they are talking about... that's why I'm asking on forums so they will tell the same but in understandable way. :)

    Cheers

Similar Threads

  1. "header" of jsp files - simple question
    By avallach in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-23-2014, 10:08 AM
  2. Replies: 0
    Last Post: 12-07-2012, 09:29 AM
  3. Replies: 3
    Last Post: 10-30-2012, 04:06 PM
  4. Simple "Refresh" and "Forward" buttons
    By needSolution in forum AWT / Swing
    Replies: 3
    Last Post: 12-12-2011, 02:15 AM
  5. Replies: 1
    Last Post: 10-20-2008, 08:35 AM

Posting Permissions

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