1077 |
|
|
1078 |
setModel(new DefaultListModel()); |
setModel(new DefaultListModel()); |
1079 |
setSelectionModel(createSelectionModel()); |
setSelectionModel(createSelectionModel()); |
1080 |
|
setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
1081 |
|
|
1082 |
updateUI(); |
updateUI(); |
1083 |
} |
} |
1323 |
|
|
1324 |
|
|
1325 |
/** |
/** |
1326 |
* Returns index of the cell to which specified location is closest to |
* Returns index of the cell to which specified location is closest to. If |
1327 |
|
* the location is outside the bounds of the list, then the greatest index |
1328 |
|
* in the list model is returned. If the list model is empty, then |
1329 |
|
* <code>-1</code> is returned. |
1330 |
|
* |
1331 |
* @param location for which to look for in the list |
* @param location for which to look for in the list |
1332 |
* |
* |
1333 |
* @return index of the cell to which specified location is closest to. |
* @return index of the cell to which specified location is closest to. |
1625 |
* #listListener} is unsubscribed from the existing model, if it exists, |
* #listListener} is unsubscribed from the existing model, if it exists, |
1626 |
* and re-subscribed to the new model. |
* and re-subscribed to the new model. |
1627 |
* |
* |
1628 |
* @param model The new property value |
* @param model the new model (<code>null</code> not permitted). |
1629 |
|
* |
1630 |
|
* @throws IllegalArgumentException if <code>model</code> is |
1631 |
|
* <code>null</code>. |
1632 |
*/ |
*/ |
1633 |
public void setModel(ListModel model) |
public void setModel(ListModel model) |
1634 |
{ |
{ |
1635 |
|
if (model == null) |
1636 |
|
throw new IllegalArgumentException("Null 'model' argument."); |
1637 |
if (this.model == model) |
if (this.model == model) |
1638 |
return; |
return; |
1639 |
|
|