[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How can i use dom event to detect any modification to cert
å´æ¹ wrote: > I 'v read a lot of w3c specs about dom event. > But still I don't know how to create or invoke dom events in java. > java 1.5 does have the org.w3c.dom.events package which contains lots > of dom event interfaces, but how to implement them seems to be a > question that we programmers should answer. Am I right? or there 'r > already any implementation of these interfaces in java? > Any help would mean a lot to me! You create an event by casting the Document to a DocumentEvent and calling createEvent. You dispatch an event to a node in the tree by casting it to an EventTarget and calling dispatchEvent on it. You receive events by registering yourself as an EventListener on an EventTarget (addEventListener), whereupon you will receive events dispatched to that target (and possibly its descendents). You can determine whether the implementation supports events by getting the DOMImplementation (Document.getImplementation) and calling hasFeature("events", "2.0") (or "uievents", "mutationevents", "htmlevents"). GNU Classpath, used in gcj, jamvm, sablevm, kaffe, cacao, and most other free JVMs, supports DOM events. I can't speak for other implementations. -- Chris Burdess
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|