• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getID()

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the number returned by getID() of the class java.awt.AWTEvent
API says getID() returns the type of an event.
What is meant by "type of an event" ? How do we know what are the different "types" correlating to the integers(int) returned by getID()
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The event handling model in Java changed with the
release of JDK 1.1 five years ago or so. Before
that, event handling used the Event object id field
like so:

That example is from the handleEvent() method in
an old JDK 1.0 example program from Sun.
Nowadays we use Adapters or Listeners to catch and
handle the events of interest without resorting to
stuff like that. (We had to ask the event what its
target was, too.)
If you are interested in that older stuff, Sun still
has the examples available online.
http://java.sun.com/docs/books/chanlee/first_edition/examples.html
I suggest you work through their online Java tutorial.
It really is a good introduction to Java, and the
online version is free. It can answer questions like
this and your other post on enableEvents() without
you having to wait and check for replies and wait
and check for replies and wait...
http://java.sun.com/docs/books/tutorial/
HTH,
Joe
 
reply
    Bookmark Topic Watch Topic
  • New Topic