![]() ![]() ![]() |
|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Training Index
Using the List Componentby
Exercise
API Docs
About This Short Course
Short Course
Exercises
Help is available for each task.
Task 1To receive the item events, add the applet itself as an To the class definition, add: implements ItemListener In the list.addItemListener(this); This means that the current applet is functioning as the listener, that is, the
target, for all item events distributed by the source, in this case, Define the public void itemStateChanged(ItemEvent e) { String item = list.getSelectedItem(); if (item ! = null && item.length() > 0) tf.setText(item); else tf.setText("No font selection."); }
Copyright 1996-2000 jGuru.com. All Rights Reserved. |