Java-gnome
| Company type | Free software project |
|---|---|
| Industry | Software development |
| Founded | October 8, 1999 |
| Headquarters | Linux and Unix-based OS communities |
Key people | Andrew Cowie (principal architect) |
| Products | Java bindings for GNOME and GTK |
| Owner | Java-gnome hackers group |
| Website | wiki |
java-gnome comprises a collection of language bindings tailored for the Java programming language to facilitate development within the GNOME desktop environment. As an integral component of the official GNOME language bindings, it offers libraries that empower programmers to build GNOME applications using Java alongside the GTK cross-platform widget toolkit.
Development
The initial release of java-gnome occurred on October 8, 1999 (version 0.2), providing bindings for both GNOME and GTK. Until version 2.0, its development was managed by a dedicated project team. The present iteration, version 4.0, originated from an internal initiative at , a consultancy specializing in change management.
From 1999 until 2006, efforts concentrated primarily on the 2.x branch. Due to development challenges, stewardship transitioned in 2006. The final update in this series was version 2.16.2, compatible with GTK up to version 2.6. This branch was officially designated as end-of-life, ceasing maintenance and rejecting patches for releases preceding version 4.0.
Although versions 2.0 and 4.0 exhibit comparable coding conventions, they differ notably in their package organization, class definitions, and method identifiers. Version 4.0 introduced substantial internal redesigns, limiting external access to its inner components.
Presently, maintenance of java-gnome is overseen by the "Java-gnome hackers" group, with leadership provided by Andrew Cowie, who serves as the project's principal architect.
Functions
Utilizing the Java programming language along with a Java-based class framework, java-gnome facilitates the creation of GUI elements. In version 4.0, significant packages include:
- GTK - The fundamental widget toolkit.
- GDK - Provides low-level drawing operations predominantly through Cairo.
- Glib and Gobject - Frameworks supporting object-oriented paradigms.
- Pango - Engine responsible for text layout.
- ATK - Implements accessibility features.
- GtkSourceView - Enables syntax highlighting for source code.
- LibNotify - Manages notification delivery.
- GtkSpell - Offers spellchecking capabilities.
- LibUnique - Guarantees that only one instance of an application runs at a time.
Support
Unlike other GTK bindings that operate across various platforms, java-gnome is exclusively supported on Linux and Unix-based operating systems. Distribution-specific installation procedures are available for:
Limited setup guidance is also provided for Open Solaris and Fedora Core distributions.
Licensing
Java-gnome is distributed as free software under the terms of the GNU GPL version 2.
Example
When compiling a java-gnome class, it is necessary to include gtk-4.1.jar in the classpath. This jar file can be found within the libjava-gnome-java package on Debian and related distributions, typically located at /usr/share/java.
<syntaxhighlight lang="java"> package org.wikipedia.javagnome.example;
import org.gnome.gdk.Event; import org.gnome.gtk.Gtk; import org.gnome.gtk.Window; import org.gnome.gtk.WindowPosition;
public class GdkSimple extends Window {
public GdkSimple() {
setTitle("Example");
connect((DeleteEvent)(source, event) -> {
Gtk.mainQuit();
return false;
});
setDefaultSize(250, 150);
setPosition(WindowPosition.CENTER);
show();
}
public static void main(String[] args) {
Gtk.init(args);
new GdkSimple();
Gtk.main();
}
} </syntaxhighlight>
See also
- GTK
- Clutter