2. คำนวณ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 2-16  โปรแกรมลากเส้นโดยเมท็อด drawLine ของ DWindow
import jlab.graphics.DWindow;

public class LineDrawing {
  public static void main(String[] args) {
    DWindow w = new DWindow(200, 200);
    w.drawLine(100, 10, 100, 190);
    w.drawLine(10, 100, 190, 100);
  }
}
©2009 S.Prasitjutrakul