- Java 9:Building Robust Modular Applications
- Dr. Edward Lavieri Peter Verhas Jason Lee
- 232字
- 2025-04-04 17:08:33
Enabling GTK 3 on Linux [JEP 283]
GTK+, formally known as the GIMP toolbox, is a cross-platform tool used for creating Graphical User Interfaces (GUI). The tool consists of widgets accessible through its API. JEP 283's focus was to ensure GTK 2 and GTK 3 were supported on Linux when developing Java applications with graphical components. The implementation supports Java apps that employ JavaFX, AWT, and Swing.
We can create Java graphical applications with JavaFX, AWT, and Swing. Here is a table to summarize those three approaches as they relate to GTK, prior to Java 9:
Approach | Remarks |
JavaFX |
|
AWT |
|
Swing |
|
So, what changes were necessary to implement this JEP? For JavaFX, three specific things were changed:
- Automated testing was added for both GTK 2 and GTK 3
- Functionality was added to dynamically load GTK 2
- Support was added for GTK 3
For AWT and Swing, the following changes were implemented:
- Automated testing was added for both GTK 2 and GTK 3
- AwtRobot was migrated to GTK 3
- FileChooserDilaog was updated for GTK 3
- Functionality was added to dynamically load GTK 3
- The Swing GTK LnF was modified to support GTK 3
Swing GTK LnF is short for Swing GTK look and feel.