BorderLayout.NORTH);
String[] vehicles = { "Volkswagen", "Rolls-Royce", "Toyota",
"Chrysler", "Mercedes Benz", "Bentley", "Bugatti",
"Maserati", "Porsche"};
DefaultListModel model = new DefaultListModel();
int columns = 0;
for (int i = 0; i < vehicles.length; i++) {
model.addElement(vehicles[ i]);
if (vehicles[ i].length() > columns)
columns = vehicles[ i].length();
}
model.addListDataListener(this);
_vehicleList = new JList(model);
_vehicleList.setVisibleRowCount(5);
_vehicleList.setColumns(columns);
_vehicleList.addListSelectionListener(this);