home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / Documents / JAVA Programming / examples / 16 / ScrollbarDemo.java < prev    next >
Encoding:
Java Source  |  2000-09-08  |  661 b   |  19 lines

  1. /* <applet code = "ScrollbarDemo" width=200 height=100>
  2.    </applet>
  3. */ 
  4. import java.awt.*;
  5. import java.applet.*;
  6. public class ScrollbarDemo extends Applet { 
  7. public void init() { 
  8. setLayout(null);
  9. int width = Integer.parseInt(getParameter("width"));
  10. int height = Integer. parseInt(getParameter("height"));
  11. Scrollbar hs = new Scrollbar(Scrollbar.HORIZONTAL, 50, width / 10, 0,               100);
  12. Scrollbar vs = new Scrollbar(Scrollbar.VERTICAL, 50, height / 2, 0, 100);
  13. add(hs);
  14. add(vs);
  15. int thickness = 16;
  16. hs.reshape(0, height - thickness, width - thickness, thickness);
  17. vs.reshape(width - thickness, 0, thickness, height - thickness);
  18. } }
  19.