This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Events Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Events" Watch "Events" New topic


Ranch Hand

Joined: Jul 20, 2000
Posts: 112
Hi All,
Can anyone help me with this ?
If a component uses enableEvent() to handle a certain event mask, it may or may not use an Adapter as a listener for this event. True Or False

public class TestFrame extends Frame {
public TestFrame(String title) {

public void processWindowEvent(WindowEvent we) {
System.out.println("Window event processed");
1. The window listener that has been addded to the TestFrame will be called on every window Object.
2. This code will compile & run if a window listener is added to an instance of TestFrame.
3. An exception is thrown if a window listener is added to TestFrame.
4. The window Listener that has been added to the TestFrame will never been called
5. This code will not compile if a window listenr is added to the TestFrame.
Can anyone explain ......why use enableEvents() instead of implementing the appropriate liseners...... ?
Thx in Advance
I agree. Here's the link:
subject: Events
It's not a secret anymore!