Results 1 to 2 of 2

Thread: ActionListener Usage.

  1. #1

    ActionListener Usage.

    How do I properly use a ActionListener in JAVA to have a trafficlight be able to turn each light on and off?

    I have a homework assignment that I need to make a traffic light that is turned on using buttons. I have everything done except linking the buttons to the lights. Any help would be great. Thanks.

  2. #2
    Okay, I've got the buttons working, but its not too effective, I have four buttons, red, yellow, green, and a 'test' button which turns all the lights on. Is there a way to use a listener for multiple buttons, because the one i am using now really is only good for 2 buttons as opposed to 4.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012