hi mita,
here is the explanation.
public Scrollbar(int orientation,int value, int visible,int minimum,int maximum)
The orientation argument must take one of the two values Scrollbar.HORIZONTAL
, or Scrollbar.VERTICAL, indicating a horizontal or vertical scroll bar, respectively.
If the specified maximum value is less than the minimum value, it is changed to be the same as the minimum value. If the initial value is lower than the minimum value, it is changed to be the minimum value; if it is greater than the maximum value, it is changed to be the maximum value.
Parameters:
--------------------------------------------------------
Orientation -indicates if the scroll bar is vertical or horizontaldefault value is Scrollbar.VERTICAL
--------------------------------------------------------
value-value which controls the location of the scroll bar bubbledefault value is 0
------------------------------------------------------------
minimumminimum value of the scroll bar.
default -0
----------------------------------------------------------
maximummaximum value of the scroll bar.default-100
---------------------------------------------------------
here is the example run it/ modify it. may be it'll help u
------------------------------
import java.awt.*;
class Scrollbars extends Frame
{
Scrollbars()
{
//red VERTICAL scrollbar
Scrollbar redbar =new Scrollbar(Scrollbar.VERTICAL, 20, 50, 10, 255);
//blue VERTICAL scrollbar
Scrollbar bluebar =new Scrollbar(Scrollbar.VERTICAL, 200, 10, 100, 255);
// blue HORIZONTAL scrollbar
Scrollbar greenbar =new Scrollbar(Scrollbar.HORIZONTAL, 50, 5, 5, 255);
redbar.setBackground(Color.red);
greenbar.setBackground(Color.green);
bluebar.setBackground(Color.blue);
add(greenbar,BorderLayout.NORTH);
add(bluebar,BorderLayout.WEST);
add(redbar,BorderLayout.EAST);
}
public static void main(String d[])
{
Scrollbars sb = new Scrollbars();
sb.setSize(400,400);
sb.setVisible(true);
}
}
------------------------------- regards
deekasha
[This message has been edited by deekasha gunwant (edited August 19, 2000).]