Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Why not using javax.swing.event with swing? (http://www.velocityreviews.com/forums/t509297-why-not-using-javax-swing-event-with-swing.html)

S.T 05-24-2007 05:51 PM

Why not using javax.swing.event with swing?
 

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.


Joshua Cranmer 05-24-2007 10:53 PM

Re: Why not using javax.swing.event with swing?
 
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.

S.T 05-25-2007 12:10 AM

Re: Why not using javax.swing.event with swing?
 
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.



All times are GMT. The time now is 05:07 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.