src/java.desktop/share/classes/java/awt/List.java

Print this page




 192      * Creates a new scrolling list initialized with the specified
 193      * number of visible lines. By default, multiple selections are
 194      * not allowed.  Note that this is a convenience method for
 195      * <code>List(rows, false)</code>.  Also note that the number
 196      * of visible rows in the list cannot be changed after it has
 197      * been created.
 198      * @param       rows the number of items to show.
 199      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 200      * returns true.
 201      * @see java.awt.GraphicsEnvironment#isHeadless
 202      * @since       1.1
 203      */
 204     public List(int rows) throws HeadlessException {
 205         this(rows, false);
 206     }
 207 
 208     /**
 209      * The default number of visible rows is 4.  A list with
 210      * zero rows is unusable and unsightly.
 211      */
 212     final static int    DEFAULT_VISIBLE_ROWS = 4;
 213 
 214     /**
 215      * Creates a new scrolling list initialized to display the specified
 216      * number of rows. Note that if zero rows are specified, then
 217      * the list will be created with a default of four rows.
 218      * Also note that the number of visible rows in the list cannot
 219      * be changed after it has been created.
 220      * If the value of <code>multipleMode</code> is
 221      * <code>true</code>, then the user can select multiple items from
 222      * the list. If it is <code>false</code>, only one item at a time
 223      * can be selected.
 224      * @param       rows   the number of items to show.
 225      * @param       multipleMode   if <code>true</code>,
 226      *                     then multiple selections are allowed;
 227      *                     otherwise, only one item can be selected at a time.
 228      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 229      * returns true.
 230      * @see java.awt.GraphicsEnvironment#isHeadless
 231      */
 232     public List(int rows, boolean multipleMode) throws HeadlessException {




 192      * Creates a new scrolling list initialized with the specified
 193      * number of visible lines. By default, multiple selections are
 194      * not allowed.  Note that this is a convenience method for
 195      * <code>List(rows, false)</code>.  Also note that the number
 196      * of visible rows in the list cannot be changed after it has
 197      * been created.
 198      * @param       rows the number of items to show.
 199      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 200      * returns true.
 201      * @see java.awt.GraphicsEnvironment#isHeadless
 202      * @since       1.1
 203      */
 204     public List(int rows) throws HeadlessException {
 205         this(rows, false);
 206     }
 207 
 208     /**
 209      * The default number of visible rows is 4.  A list with
 210      * zero rows is unusable and unsightly.
 211      */
 212     static final int    DEFAULT_VISIBLE_ROWS = 4;
 213 
 214     /**
 215      * Creates a new scrolling list initialized to display the specified
 216      * number of rows. Note that if zero rows are specified, then
 217      * the list will be created with a default of four rows.
 218      * Also note that the number of visible rows in the list cannot
 219      * be changed after it has been created.
 220      * If the value of <code>multipleMode</code> is
 221      * <code>true</code>, then the user can select multiple items from
 222      * the list. If it is <code>false</code>, only one item at a time
 223      * can be selected.
 224      * @param       rows   the number of items to show.
 225      * @param       multipleMode   if <code>true</code>,
 226      *                     then multiple selections are allowed;
 227      *                     otherwise, only one item can be selected at a time.
 228      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 229      * returns true.
 230      * @see java.awt.GraphicsEnvironment#isHeadless
 231      */
 232     public List(int rows, boolean multipleMode) throws HeadlessException {