Using JNI graphics API