Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package kolos;
  2.  
  3. import java.awt.*;
  4. import java.util.Random;
  5.  
  6. public class Kwadrat {
  7.         float a, b, x, y;
  8.         Color c;
  9.  
  10.         public Kwadrat(float x, float y, float a, float b){
  11.                 this.x = x;
  12.                 this.y = y;
  13.                 this.a = a;
  14.                 this.b = b;
  15.         }
  16.  
  17.         public void draw(Graphics g) {
  18.                 g.setColor(Color.yellow);
  19.                 g.fillRect((int)(x-a),(int)(y-a), (int)a, (int)b);
  20.  
  21.         }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement