Home     |     Java    |     Php General    |     Oracle Database    |     Oracle Server  

MS Dynamics CRM 3.0

  •  Setting up and Configuring Microsoft Dynamics CRM 3.0
  •  Managing Security and Information Access
  •  Entity Customization: Concepts and Attributes
  •  Entity Customization: Forms and Views
  •  Entity Customization: Relationships, Custom Entities, and Site Map
  •  Reporting and Analysis
  •  Workflow
  •  Server-Side SDK
  •  Client-Side SDK
  •  Integration with External Applications
  • Cervo Technologies
    The Right Source to Outsource

    Sharepoint Portal Server KB

    Microsoft CRM Info

    WPF Interview Questions

    SilverLight Interview Qs

    Asp.Net 2.0 Interview Qs

    Asp.NET 1.1 FAQs

    Oracle Interview Questions

    SAP Interview Questions

    Java Programming

    Query:is there the concept of priority level in java's event response system?


    Hello Everybody:
    I am indulging in java's gui programing these days.
    Yesterday,I created a tree using class JTree.I've tried two ways to
    response TreeSelectEvent,one is by implementing interface
    treeSelectionListener,the other is by MosueListener.
    They both worked well when applied alone.But when I employed them both
    at the same time,only MouseListener worked,so I think there might be
    some concepts like priority level in java's event response system?
    Am I right? Or there might have something else happened?

    Thanks.
    Dowson.

    Jack Dowson wrote:
    > Yesterday,I created a tree using class JTree.I've tried two ways to
    > response TreeSelectEvent,one is by implementing interface
    > treeSelectionListener,the other is by MosueListener.
    > They both worked well when applied alone.But when I employed them both
    > at the same time,only MouseListener worked,so I think there might be
    > some concepts like priority level in java's event response system?

    AWT's MouseListener and MouseMotionListener handling is broken. This
    causes many bugs and peculiar behaviour.

    Unlike every other event, if a component has no mouse [motion] listener
    then mouse events are bubbled up to the parent container. This means you
    can get away with listening to a parent component, and still receive
    events for all of its children.

    However, events are supposed to be multicast and listeners should not
    interfere with one another. If some other code, quite reasonably, adds a
    mouse [motion] listener to a child component, then the events wont get
    bubbled up.

    This is spectacularly bad design.

    So, prefer the higher level event types. Mouse [motion] listeners are
    fine if and only if you are defining your own subclass of JComponent or
    implementing a PL&F.

    Otherwise there are hacks to get the low-level events. The best is to
    push a java.awt.EventQueue that intercepts events as they are
    dispatched. This works with standard applet/web start permissions (from
    1.2.2, IIRC). However, you do lose system copy & paste support and
    potentially other features of trusted libraries.

    Another approach is to use Toolkit.addAWTEventListener. This does not
    work at all for untrusted code, so avoid if you can. This technique is
    used by the Basic PL&F to implement pop ups on components from 1.5, and
    activating internal frames from 1.6.

    The most popular approach is 'glass panes', which are really broken.
    Avoid at all costs.

    Tom Hawtin

    Thank you so much!
    Dowson.
    Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc