home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / unuy2wen / cybcerone / utils / paperbutton.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  676 b   |  34 lines

  1. // PaperButton.java
  2. // 28.02.96
  3. //
  4. // the buttons on a page
  5.  
  6. package cybcerone.utils;
  7.  
  8. import java.awt.Image;
  9. import java.awt.image.ImageObserver;
  10. import java.awt.Rectangle;
  11. import java.awt.Graphics;
  12.  
  13. /**
  14.  * The little up and down arrows that let you scroll on ScrollingPaper.
  15.  */
  16. class PaperButton {
  17.   Image theImage;
  18.   Rectangle placement;
  19.  
  20.   PaperButton (Image theImage, Rectangle placement) {
  21.     this.theImage = theImage;
  22.     this.placement = placement;
  23.   }
  24.  
  25.   public boolean inside (int x, int y) {
  26.     return placement.inside (x, y);
  27.   }
  28.  
  29.   public void paint (Graphics g, ImageObserver observer) {
  30.     g.drawImage (theImage, placement.x, placement.y, observer);
  31.   }
  32. }
  33.  
  34.