9. สร้างใหม่จากเก่า

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.

 
รหัสที่ 9-4  ตัวอย่างการใช้งานคลาส DotMatrixLED
import jlab.graphics.DWindow;
public class TestDotMatrixLED {
  public static void main(String[] args) {
    boolean[][] J = {{ false, false,  true, true, true },
                     { false, false, false, true, false },
                     { false, false, false, true, false },
                     { false, false, false, true, false },
                     { false, false, false, true, false },
                     { true,  false, false, true, false },
                     { false,  true,  true, false, false } };
    DotMatrixLED led = new DotMatrixLED(5, 7);
    led.setColor(DWindow.GREEN);
    led.setWidth(100);
    led.setDots(J);
    DWindow w = new DWindow(200, 150);
    w.setBackground(DWindow.BLACK);
    led.draw(w, 50, 5);
  }
}
©2009 S.Prasitjutrakul