1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
/* Deselect Item From AWT List Example This java example shows how to deselect item from a list using Java AWT List class. */ import java.applet.Applet; import java.awt.List; /* <applet code="DeselectItemFromAListExample" width=200 height=200> </applet> */ public class DeselectItemFromAListExample extends Applet{ public void init(){ //create a list List list = new List(5, true); //add items to a list list.add("One"); list.add("Two"); list.add("Three"); list.add("Four"); list.add("Five"); list.add("Six"); list.add("Seven"); //add list add(list); //select an item list.select(1); /* * To deselect an item from a list, use * void deselect() * method of AWT List class. */ list.deselect(1); } } |
Example Output
Add Comment