Providing Choices, Making Lists
You are likely to encounter situations where it would be nice to provide your users with a list of choices. For example, you’ve probably selected the name of the city where you live from a list. Maybe you want to build an application to keep track of the books or movies that you own. Fortunately, Swing provides the JList1 component, which allows programmers to build and display lists of this sort. In this chapter, you learn how to build and display a list of items. You will also learn how to manipulate a list in the event handler method associated with another component, such as a button.
Making a List ...