Pastebin
81777 geplaatste codes! 

Deprecated: Assigning the return value of new by reference is deprecated in /home/joel/domains/plaatscode.be/public_html/toon.php on line 13

Plaats #33080 (Java)

Gepost op 19-10-2008 13:51 door keffie91
Downloaden als .txt-bestand - Bewerk en post opnieuw
  1. import java.awt.*;
  2. import java.io.*;
  3. public class Line implements Serializable {
  4.         public Point p1, p2;/* new Points, the points where you pressed and
  5.          released the mouse*/
  6.        
  7.         public Line(){
  8.                 p1 = new Point();
  9.                 p2 = new Point();
  10.         }
  11.         public Line(Point a, Point b){
  12.                 p1 = new Point(a);
  13.                 p2 = new Point(b);
  14.         }
  15.         public void draw(Graphics g){
  16.             //draw the line
  17.             g.drawLine(p1.x, p1.y, p2.x, p2.y);
  18.         }
  19. }
© 2014 Sitemasters.be - Gehost door Vircon