• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

scrollbar constructor

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am confused with the Scrollbar's costructor.Could someone please explain what are initialvalue, slidersize, minvalue & maxvalue if possible with an example.
Thanks.
mita
Scrollbar(int Orientation, int initialvale, int slidersize, int minvalue, int maxvalue)
 
mita
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
PLEASE someone help me.I know this is a simple question, but I can't get it.
Thanks
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
mita
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much Deekasha.I appreciate it.
mita
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic