/[classpath]/classpath/javax/swing/JList.java
ViewVC logotype

Diff of /classpath/javax/swing/JList.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16.2.14 by tromey, Sat Nov 26 05:29:42 2005 UTC revision 1.16.2.15 by gnu_andrew, Sun Nov 27 21:00:37 2005 UTC
# Line 1077  public class JList extends JComponent im Line 1077  public class JList extends JComponent im
1077    
1078      setModel(new DefaultListModel());      setModel(new DefaultListModel());
1079      setSelectionModel(createSelectionModel());      setSelectionModel(createSelectionModel());
1080        setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
1081    
1082      updateUI();      updateUI();
1083    }    }
# Line 1322  public class JList extends JComponent im Line 1323  public class JList extends JComponent im
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.
# Line 1620  public class JList extends JComponent im Line 1625  public class JList extends JComponent im
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            

Legend:
Removed from v.1.16.2.14  
changed lines
  Added in v.1.16.2.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26