CheerpJ功能强大,因为JAVA有两种方式,自然也要对应。
- 网页
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>CheerpJ test</title> <script src="https://cjrtnc.leaningtech.com/2.1/loader.js"></script> </head> <body> </body> <script> </script> </html>
差别就是在script中插入什么样的代码。具体来说:
- jar方式
cheerpjInit(); cheerpjCreateDisplay(800,600); cheerpjRunJar("/app/TextDemo.jar");
- CLASS方式
cheerpjInit(); cheerpjCreateDisplay(800,600); cheerpjRunMain("ChangeThisToYourClassName", "/app/app_archive.jar:/app/dependency_archive.jar");