< prev index next >

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

Print this page




 283      */
 284     private static native void initIDs();
 285 
 286     static {
 287         /* ensure that the necessary native libraries are loaded */
 288         Toolkit.loadLibraries();
 289         if (!GraphicsEnvironment.isHeadless()) {
 290             initIDs();
 291         }
 292     }
 293 
 294     /**
 295      * Constructs a new vertical scroll bar.
 296      * The default properties of the scroll bar are listed in
 297      * the following table:
 298      *
 299      * <table class="striped">
 300      * <caption>Scrollbar default properties</caption>
 301      * <thead>
 302      * <tr>
 303      *   <th>Property</th>
 304      *   <th>Description</th>
 305      *   <th>Default Value</th>
 306      * </tr>
 307      * </thead>
 308      * <tbody>
 309      * <tr>
 310      *   <td>orientation</td>
 311      *   <td>indicates whether the scroll bar is vertical
 312      *   <br>or horizontal</td>
 313      *   <td>{@code Scrollbar.VERTICAL}</td>
 314      * </tr>
 315      * <tr>
 316      *   <td>value</td>
 317      *   <td>value which controls the location
 318      *   <br>of the scroll bar's bubble</td>
 319      *   <td>0</td>
 320      * </tr>
 321      * <tr>
 322      *   <td>visible amount</td>
 323      *   <td>visible amount of the scroll bar's range,
 324      *   <br>typically represented by the size of the
 325      *   <br>scroll bar's bubble</td>
 326      *   <td>10</td>
 327      * </tr>
 328      * <tr>
 329      *   <td>minimum</td>
 330      *   <td>minimum value of the scroll bar</td>
 331      *   <td>0</td>
 332      * </tr>
 333      * <tr>
 334      *   <td>maximum</td>
 335      *   <td>maximum value of the scroll bar</td>
 336      *   <td>100</td>
 337      * </tr>
 338      * <tr>
 339      *   <td>unit increment</td>
 340      *   <td>amount the value changes when the
 341      *   <br>Line Up or Line Down key is pressed,
 342      *   <br>or when the end arrows of the scrollbar
 343      *   <br>are clicked </td>
 344      *   <td>1</td>
 345      * </tr>
 346      * <tr>
 347      *   <td>block increment</td>
 348      *   <td>amount the value changes when the
 349      *   <br>Page Up or Page Down key is pressed,
 350      *   <br>or when the scrollbar track is clicked
 351      *   <br>on either side of the bubble </td>
 352      *   <td>10</td>
 353      * </tr>
 354      * </tbody>
 355      * </table>
 356      *
 357      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 358      * returns true.
 359      * @see java.awt.GraphicsEnvironment#isHeadless
 360      */
 361     public Scrollbar() throws HeadlessException {
 362         this(VERTICAL, 0, 10, 0, 100);
 363     }
 364 
 365     /**
 366      * Constructs a new scroll bar with the specified orientation.
 367      * <p>
 368      * The {@code orientation} argument must take one of the two
 369      * values {@code Scrollbar.HORIZONTAL},
 370      * or {@code Scrollbar.VERTICAL},
 371      * indicating a horizontal or vertical scroll bar, respectively.
 372      *
 373      * @param       orientation   indicates the orientation of the scroll bar




 283      */
 284     private static native void initIDs();
 285 
 286     static {
 287         /* ensure that the necessary native libraries are loaded */
 288         Toolkit.loadLibraries();
 289         if (!GraphicsEnvironment.isHeadless()) {
 290             initIDs();
 291         }
 292     }
 293 
 294     /**
 295      * Constructs a new vertical scroll bar.
 296      * The default properties of the scroll bar are listed in
 297      * the following table:
 298      *
 299      * <table class="striped">
 300      * <caption>Scrollbar default properties</caption>
 301      * <thead>
 302      *   <tr>
 303      *     <th scope="col">Property
 304      *     <th scope="col">Description
 305      *     <th scope="col">Default Value

 306      * </thead>
 307      * <tbody>
 308      *   <tr>
 309      *     <th scope="row">orientation
 310      *     <td>indicates whether the scroll bar is vertical or horizontal
 311      *     <td>{@code Scrollbar.VERTICAL}


 312      *   <tr>
 313      *     <th scope="row">value
 314      *     <td>value which controls the location of the scroll bar's bubble
 315      *     <td>0


 316      *   <tr>
 317      *     <th scope="row">visible amount
 318      *     <td>visible amount of the scroll bar's range, typically represented
 319      *     by the size of the scroll bar's bubble
 320      *     <td>10


 321      *   <tr>
 322      *     <th scope="row">minimum
 323      *     <td>minimum value of the scroll bar
 324      *     <td>0

 325      *   <tr>
 326      *     <th scope="row">maximum
 327      *     <td>maximum value of the scroll bar
 328      *     <td>100

 329      *   <tr>
 330      *     <th scope="row">unit increment
 331      *     <td>amount the value changes when the Line Up or Line Down key is
 332      *     pressed, or when the end arrows of the scrollbar are clicked
 333      *     <td>1



 334      *   <tr>
 335      *     <th scope="row">block increment
 336      *     <td>amount the value changes when the Page Up or Page Down key is
 337      *     pressed, or when the scrollbar track is clicked<br>on either side of
 338      *     the bubble
 339      *     <td>10


 340      * </tbody>
 341      * </table>
 342      *
 343      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 344      * returns true.
 345      * @see java.awt.GraphicsEnvironment#isHeadless
 346      */
 347     public Scrollbar() throws HeadlessException {
 348         this(VERTICAL, 0, 10, 0, 100);
 349     }
 350 
 351     /**
 352      * Constructs a new scroll bar with the specified orientation.
 353      * <p>
 354      * The {@code orientation} argument must take one of the two
 355      * values {@code Scrollbar.HORIZONTAL},
 356      * or {@code Scrollbar.VERTICAL},
 357      * indicating a horizontal or vertical scroll bar, respectively.
 358      *
 359      * @param       orientation   indicates the orientation of the scroll bar


< prev index next >