• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

mixing Hierarchical and Delegation Evt Models

 
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Java Programming Language". SL-275. Student Guide. Sun Microsystems. Revision C.1, September 1999
states on the page 9-13:<blockquote>"Although the current Java 2 SDk supports the JDK 1.0 event model in addition to the delegation model, you cannot mix the JDK1.0 and JDK1.1 event models."</blockquote>
I have difficulties with English. Does this phrase means impossibility or just a recommendation?
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
It means that it is impossible. JDK1.2 supports either, but only one will be used per application.
Regards,
Manfred.
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just curiious. Is it a compiler or run-time error?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
It is neither. The JDK 1.2 JVM will use whichever one is called for. This was required so that people who compiled JDK 1.0 class files could still work with Java 2. You can't choose which one to use if you compile with JDK1.2. You will get event delegation if you like it or not ...
Regards,
Manfred.
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not convinced. Here is a quote from
David M.Geary Graphic Java 1.2. Vol.1 AWT. The Sun Microsystems Press, p.318:


AWT TIP...
Not All Events are Delivered to Components

A common mistake when using the inheritance-based mechanism under the delegation event model is neglecting to call enableEvents(long). Under the inheritance-based event model, all events were deliverd to a component, whether the component was interested in the event or not. The delegation event model is more selective, delivering events only to components that indicate interest in the particular type of event by calling enableEvent(long) or adding a listener to the component. Therefore, if you must use the inheritance-based mechanism, don't forget to call enableEvents() for events you are interested in."


Well, Sun seems tries to silence the inheritance-based model and there is no much to read...
But I understood that it is possible to mix event models. Other opinions?
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic