Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Example Java Awt Scrollbar

Related Tutorials


 
 

Share on Google+Share on Google+

Scrollbar

Advertisement
A scrollbar is represented by a "slider" widget. The characteristics of it are specified by integer values which are being set at the time of scrollbar construction. Both the types of Sliders are available i.e. horizontal and vertical.

Scrollbar

     

A scrollbar is represented by a "slider" widget. The characteristics of it are specified by integer values which are being set at the time of scrollbar construction. Both the types of Sliders are available i.e. horizontal and vertical

The example below shows the code for the scrollbar construction. The subtraction of scrollbar width from the maximum setting gives the maximum value of the Scrollbar. In the program code, '0' is the <<<<<<< scrollbar.shtml initial value of the scrollbar, '8' is the width of the scrollbar.

 

 

======= initial value of the scrollbar, '8' is the width of the scrollbar.

>>>>>>> 1.2
import java.awt.*; 
import java.applet.Applet; 
 
public class ScrollbarDemo extends Applet { 
  public void init() { 
  Scrollbar sb =  new Scrollbar
  (Scrollbar.VERTICAL, 
08, -100100); 
  add(sb); 
  


Here is the output:
 

C:\newprgrm>javac ScrollbarDemo.java

C:\newprgrm>appletviewer ScrollbarDemo.html

 

Download this example.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 13, 2008

Related Tutorials

Discuss: Scrollbar   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
anirudh kumar tiwari
November 22, 2012
ask question about table

dear sir/madam i want the coding of edit table using java swing.
DMCA.com