how to use .java shared by other people and add it to Ejs?

i tried to copy
http://www.huxtable.com/ip/blurring.html
http://www.huxtable.com/ip/ConvolveFilter.java

the contents of the .java file into the custom page of Ejs

there is error message

C:\Users\160\Desktop\EJS_4.2_091119\EJS_4.2\workspace\output\users\sgeducation\lookang\ejs_ImageTest\ImageTest.java:164: illegal start of type
  package com.jhlabs.image;  // > Custom.Lib Page 2:4
  ^
C:\Users\160\Desktop\EJS_4.2_091119\EJS_4.2\workspace\output\users\sgeducation\lookang\ejs_ImageTest\ImageTest.java:164: expected
  package com.jhlabs.image;  // > Custom.Lib Page 2:4
                          ^
C:\Users\160\Desktop\EJS_4.2_091119\EJS_4.2\workspace\output\users\sgeducation\lookang\ejs_ImageTest\ImageTest.java:165: illegal start of type
  import java.awt.*;  // > Custom.Lib Page 2:5
  ^
C:\Users\160\Desktop\EJS_4.2_091119\EJS_4.2\workspace\output\users\sgeducation\lookang\ejs_ImageTest\ImageTest.java:165: expected
  import java.awt.*;  // > Custom.Lib Page 2:5
                  ^
C:\Users\160\Desktop\EJS_4.2_091119\EJS_4.2\workspace\output\users\sgeducation\lookang\ejs_ImageTest\ImageTest.java:166: illegal start of type
  import java.awt.image.*;  // > Custom.Lib Page 2:6
  ^
C:\Users\160\Desktop\EJS_4.2_091119\EJS_4.2\workspace\output\users\sgeducation\lookang\ejs_ImageTest\ImageTest.java:166: expected
  import java.awt.image.*;  // > Custom.Lib Page 2:6
                        ^
C:\Users\160\Desktop\EJS_4.2_091119\EJS_4.2\workspace\output\users\sgeducation\lookang\ejs_ImageTest\ImageTest.java:167: illegal start of type
  import java.awt.geom.*;  // > Custom.Lib Page 2:7
  ^
C:\Users\160\Desktop\EJS_4.2_091119\EJS_4.2\workspace\output\users\sgeducation\lookang\ejs_ImageTest\ImageTest.java:167: expected
  import java.awt.geom.*;  // > Custom.Lib Page 2:7
                        ^
8 errors
Compilation produced an error!

is there any www that i can read to understand how to get the codes to work in Ejs?