Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

events

 
Hiep Nguyen
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all!
i am writing a xml parser, now i want post some my event into system but there are a problem that :
Class SAXEvent extends AWTEvent
CLass StrartEntityEvent axtends SAXEvent
if i post SAXEvent into EventQueue, it's ok;
but if i use StartEntityEvent, it make error :unable to dispatch event
if anyone need source code to debug, i'll send to you
thank you for your advices !
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that you've posted enough information for someone to help very much. The class heirarchy you've described doesn't appear to me to be a problem. Can you more completely describe the problem?
 
Hiep Nguyen
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear sir !
i design ma classes as flow:
class Entity; class Attribute;
class SAXEvent extend AWTEvent;
class StartDocument(Object source) extends SAXEvent;
class StartEntityEvent(Entity source) extend SAXEvent;
// more some class event
and class Parser(){};
Parser.pasre() will push those SAXEvent events into EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
like this :
eq.postEvent(new StartDocumentEvent(this));
and
eq.postEvent(new StartEntityEvent(entity));
the first event is ok but the second one throw out error like the last my post.
thank you for your reply !
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but if i use StartEntityEvent, it make error :unable to dispatch event
What exception is thrown?
[ August 27, 2002: Message edited by: Dirk Schreckmann ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic