您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Extend Index

Extend Page # 13

Exercise 5 - Categories of events

It has been stated that Button objects send an event when they are clicked. This is intuitive: the only purpose of a button is to be clicked, and then something must happen. Using your intuition and experience of how graphical user interfaces work, suggest what events will be sent by each of these objects.

Describe the events in English; don't try to guess the Java names. You may have to refer back to the text to remind yourself what these objects represent.

Hint: there is at least one for each class. Because this is an exercise in intuition, not knowledge, there are many possible correct answers.

List

Choice

Checkbox

TextField

TextArea

When you have made your list, look in the Java documentation for each class and see if your intuition agrees with that of the Java developers. In the documentation, look for methods with names like 'addXXXlistener', which 'XXX' will tell you the type of listener being used.

Discussion/Suggestion  to Exercise 5 - Categories of events

Back to top

basicline.gif (170 bytes)