Draw2D is a lightweight layout and rendering toolkit building on top of SWT. It may not as powerful as Java Swing or JavaFX, it’s very useful for displaying graphical components. This article will show you how to build a stand-alone native Java application with JFace and Draw2D, and GraalVM native image.
While SWT is great for building Java GUI with native look and feel, it would be tedious for complex application. JFace provides a set of reusable components that make it easier. and it can be used for developing a stand-alone application. Detailed step-by-step instructions are available in the Setting Up an Eclipse Project to use SWT and JFace section of the JFace article.
For this demo, you don’t need do that:
Draw2D is a layout and rendering toolkit building on top of SWT. It may be used standalone (outside of Eclipse) or in combination with the GEF or Zest component. Unfortunately, GEF 3 need Eclipse RCP, and I don’t think GraalVM native image is able to handle Eclipse RCP yet. GEF 5 is able to run as stand-alone application, but somehow build on JavaFX and only.
This demo will only using zest for layout and animation. The Web Design 28 SVG Vector Collection and Icons were used for demonstration.
./build.sh ./run -trace ./build -native
This is just a quick hack to test GraalVM native image, a lot of things need to rewrite to use more advance features of Skia Graphics Engine.