Page 2 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:, , , , Scroll bars are used to select continuous values between, a specified minimum and maximum., , , , Scroll bars may be oriented horizontally or vertically., , , , A scroll bar is actually a composite of several, individual parts., , DJ Sir
Page 3 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:, , , , Each end has an arrow that we can click to move the current, value of the scroll bar one unit in the direction of the arrow., , , , The current value of the scroll bar relative to its minimum, and maximum values is indicated by the slider box (or, thumb) for the scroll bar., , DJ Sir
Page 5 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:, , , , The slider box can be dragged by the user to a new position. The, scroll bar will then reflect this value., , , , In the background space on either side of the thumb, the user can, click to cause the thumb to jump in that direction by some, , increment larger than 1., , , Typically, this action translates into some form of page up and, page down. Scroll bars are encapsulated by the Scrollbar class., , DJ Sir
Page 6 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:Constructors, , , , Scrollbar( ) –It creates a default vertical scroll bar., , , , Scrollbar(int style)-This constructor allow us to specify the, orientation of the scroll bar. If style is Scrollbar.VERTICAL,, a vertical scroll bar is created. If style is, Scrollbar.HORIZONTAL, the scroll bar is horizontal., , DJ Sir
Page 7 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:Constructors, , , , Scrollbar(int style, int iValue, int tSize, int min, int max)In this constructor, the initial value of the scroll bar is passed, in iValue. The number of units represented by the height of, the thumb is passed in tSize. The minimum and maximum, values for the scroll bar are specified by min and max., , DJ Sir
Page 8 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:Methods, , , , int getBlockIncrement()-Gets the block increment of this, scroll bar., , , , int getMaximum()-Gets the maximum value of this scroll, bar., , , , int getMinimum()-Gets the minimum value of this scroll, bar., , DJ Sir
Page 9 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:Methods, , , , int getOrientation()-Returns the orientation of this, scroll bar., , , , int getUnitIncrement()-Gets the unit increment for this, scrollbar., , , , int getValue()-Gets the current value of this scroll bar., , DJ Sir
Page 10 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:Methods, , , , void setBlockIncrement(int v)-Sets the block increment for, this scroll bar., , , , void setMaximum(int newMaximum)-Sets the maximum, value of this scroll bar., , , , void setMinimum(int newMinimum)-Sets the minimum, value of this scroll bar., , DJ Sir
Page 11 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:Methods, , , , void setOrientation(int orientation)-Sets the, orientation for this scroll bar., , , , void setUnitIncrement(int v)-Sets the unit increment, for this scroll bar., , DJ Sir
Page 12 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:Methods, , , , void setValue(int newValue)-Sets the value of this scroll, bar to the specified value., , , , void setValues(int value, int visible, int minimum, int, maximum)-Sets the values of four properties for this, , scroll bar: value, visible, minimum, and maximum., DJ Sir
Page 13 :
1.3 AWT Controls and Layout Managers:, , , Handling Scrollbars:, , , , To process scroll bar events, you need to implement the, AdjustmentListener interface., , , , Each time a user interacts with a scroll bar, an, AdjustmentEvent object is generated., , , , Its getAdjustmentType() method can be used to determine, the type of the adjustment., , DJ Sir
Page 14 :
1.3 AWT Controls and Layout Managers:, , , Handling Scrollbars:, , , , The types of adjustment events are as follows:, , •, , BLOCK_DECREMENT-A page-down event has been generated., , •, , BLOCK_INCREMENT-A page-up event has been generated., , •, , UNIT_DECREMENT-The line-down button in a scroll bar has been, pressed., , •, , UNIT_INCREMENT-The line-up button in a scroll bar has been, pressed., , DJ Sir
Page 15 :
1.3 AWT Controls and Layout Managers:, , , Scrollbars:Example, , DJ Sir