Why not using javax.swing.event with swing?

Discussion in 'Java' started by S.T, May 24, 2007.

  1. S.T

    S.T Guest

    Hi!

    Getting warm with Java this week, I have learned that the usage of
    Swing is highly recommended. I have seen many examples up to now, most
    of them actually preferring Swing. However, I wonder why all of them
    implement the old-fashioned (is it really?) AWT-only eventListener.
    Why is this? Is something wrong with javax.swing.event ?

    Sincerly,

    S.T.
    S.T, May 24, 2007
    #1
    1. Advertising

  2. S.T wrote:
    > Hi!
    >
    > Getting warm with Java this week, I have learned that the usage of
    > Swing is highly recommended. I have seen many examples up to now, most
    > of them actually preferring Swing. However, I wonder why all of them
    > implement the old-fashioned (is it really?) AWT-only eventListener.
    > Why is this? Is something wrong with javax.swing.event ?
    >
    > Sincerly,
    >
    > S.T.
    >


    Look at the classes in javax.swing.event... How many of them implement
    basic functionality like MouseMove, etc.? Zero. The events in
    javax.swing.event are those that are specific to Swing, like JTables or
    JLists; the most commonly needed events are stored in java.awt.event.

    Besides, the java.awt.event is NOT AWT-only; all Swing components are
    really AWT components, so there was no sense in duplicating an entire
    event hierarchy because of the addition of Swing.
    Joshua Cranmer, May 24, 2007
    #2
    1. Advertising

  3. S.T

    S.T Guest

    Dear Joshua,

    thank you very much for your precise answer. Now the usage of AWT
    eventListeners with Swing makes sense to me.

    Sincerly
    S.T.
    S.T, May 25, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    741
    Esmond Pitt
    Mar 27, 2005
  2. lizard
    Replies:
    0
    Views:
    1,765
    lizard
    Jan 30, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,849
    Smokey Grindel
    Dec 2, 2006
  4. Andrew Thompson

    javax.servlet and javax.servlet.http

    Andrew Thompson, Apr 24, 2007, in forum: Java
    Replies:
    1
    Views:
    658
    newbie_at_tomcat
    Apr 25, 2007
  5. Lew
    Replies:
    1
    Views:
    614
    newbie_at_tomcat
    Apr 25, 2007
Loading...

Share This Page