ListBox -Add items r After we create a listBox object, we add items to it as colorIst. addItem(" Magenta)i colorIst. addItem(Cyan")i The items will be added to colorIst. addItem(Red")i the list in the order colorIst. addItem(" Blue") addltem is executed colorIst. addItem(" Green")i r Then we execute selection colorIst. getselectedIndex()i to make the colorIst appear on the screen C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 6-20© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 6 - 20 ListBox – Add Items After we create a ListBox object, we add items to it as colorList.addItem("Magenta"); colorList.addItem("Cyan"); colorList.addItem("Red"); colorList.addItem("Blue"); colorList.addItem("Green"); The items will be added to the list in the order addItem is executed. Then we execute selection = colorList.getSelectedIndex(); to make the colorList appear on the screen…