7. แถวลำดับ

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.

 
รหัสที่ 7-28  ตัวอย่างการใช้งานเมท็อด getPixmap และ setPixmap
import jlab.graphics.DWindow;
public class TestPixmap {
  public static void main(String[] args) {
    DWindow w = new DWindow(200,100);
    int[][] p = w.getPixmap();
    for (int x = 0; x < p.length; x += 10) {
      for (int y = 0; y < p[0].length; y++) {
        p[x][y] = DWindow.BLACK;
      }
    }
    w.setPixmap(p);
  }
}
©2009 S.Prasitjutrakul