This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes scrollbar constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "scrollbar constructor" Watch "scrollbar constructor" New topic

scrollbar constructor

Ranch Hand

Joined: Jul 19, 2000
Posts: 50
I am confused with the Scrollbar's costructor.Could someone please explain what are initialvalue, slidersize, minvalue & maxvalue if possible with an example.
Scrollbar(int Orientation, int initialvale, int slidersize, int minvalue, int maxvalue)
Ranch Hand

Joined: Jul 19, 2000
Posts: 50
PLEASE someone help me.I know this is a simple question, but I can't get it.
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
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.
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

//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);

public static void main(String d[])
Scrollbars sb = new Scrollbars();

[This message has been edited by deekasha gunwant (edited August 19, 2000).]
Ranch Hand

Joined: Jul 19, 2000
Posts: 50
Thanks so much Deekasha.I appreciate it.
I agree. Here's the link:
subject: scrollbar constructor
Similar Threads
max and min in array?
How to assign a return method's value to two variables
Problem with appearance of JProgressBar
purpose of a function
double precision floating point