Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a new event model in the 1.0 JDK?

event JDK model
0
10 Posted

Is there a new event model in the 1.0 JDK?

0
10

Yes. In beta and earlier versions of the JDK, programs using the AWT couldn’t intercept events that were sent to native widgets. Now they can. In theory, an AWT program can subclass a component, say a TextField, override its handleEvent() method, and can then: • Pass the event along unmodified, by returning false. • Pass the event along with modifications by modifying the event and then returning false. • Consume the event without passing it on by returning true. If a component’s handleEvent() method returns false, the event keeps traveling up the containment hierarchy. If none of the component’s parents return true from their handleEvent() methods, the event is then sent to the peer which will then consume the event. For 1.0, however, the only events that an AWT program can filter are keyboard events. Future versions of the JDK will allow the AWT to filter all events. Note also that if an applet’s TextFields don’t seem to be getting any keyboard input, it’s because the applet is incor

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123