event handling with swing (ActionListener)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stmfc
    New Member
    • May 2007
    • 65

    #1

    event handling with swing (ActionListener)

    KeyListener listens keyboard strokes,
    MouseListener listens mouse events, etc.

    My question is about ActionListener.
    what kind of events does ActionListener listen?

    its name does not give much information, or does it listen all possible events?
    can you give an example?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by stmfc
    KeyListener listens keyboard strokes,
    MouseListener listens mouse events, etc.

    My question is about ActionListener.
    what kind of events does ActionListener listen?

    its name does not give much information, or does it listen all possible events?
    can you give an example?
    Not all possible events. Most common examples are Button click and enter on a TextField

    Comment

    • stmfc
      New Member
      • May 2007
      • 65

      #3
      Originally posted by r035198x
      Not all possible events. Most common examples are Button click and enter on a TextField
      where can i find the full list of these supported events?
      i checked the jdk documentation, but could not find there.
      Last edited by stmfc; Sep 13 '07, 12:47 PM. Reason: not to cause confusion

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by stmfc
        where can i find the full list of these supported events?
        i checked the jdk documentation, but could not find there.
        Key and Mouse (Motion) events are so called "low level" events. The other events
        are "high level" events not directly caused by a device of some sort. The high
        level events notify the listeners of bounded (or "vetoable") property changes and
        (optionally) required actions. Note that most of Swings JComponents fire quite
        a lot of those "high level" events in sequence when something simple such as a
        mouse press happens: it could've been on a button that scrolls a list that hides,
        exposes a certain element etc.

        kind regards,

        Jos

        Comment

        Working...