java-gnome
Stable release | |
---|---|
Development status | Active |
Written in | C and Java |
Operating system | UNIX-like |
Type | GUI language bindings for java |
License | GNU General Public License with exception. |
Website |
java-gnome |
java-gnome is a set of language bindings for the Java programming language for use in the GNOME desktop environment. It is part of the official GNOME language bindings suite and provides a set of libraries allowing developers to write computer programs for GNOME using the Java programming language and the GTK+ cross-platform widget toolkit.
Up until version 2.0, java-gnome was written by a project team,[2] the current version 4.0 was originally an internal project of Operational Dynamics, a change management consultancy group.[3] This new version is a complete re-write of java-gnome and was originally written for creating business tools to the company's clients, but eventually grew into a full replacement Java language binding for GNOME.
Unlike most other GTK+ bindings, there is no version available for Microsoft Windows.
Java-gnome is free software released under the terms of the GNU General Public License.[4]
Example
To compile a java-gnome class it's necessary to add the gtk-4.1.jar jar in the classpath. The jar is available on Debian (and all Debian-based distributions) in the libjava-gnome-java[5] package, which can be found in the official repositories (the jar is installed under the /usr/share/java path).
![](../I/m/GtkExample.png)
package org.wikipedia.javagnome.example;
import org.gnome.gdk.Event;
import org.gnome.gtk.Gtk;
import org.gnome.gtk.Widget;
import org.gnome.gtk.Window;
import org.gnome.gtk.WindowPosition;
/**
* Java-Gnome GTK Example
* ispired official site java-gnome.sourceforge.net
*/
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();
}
}
See also
References
- ↑ http://ftp.gnome.org/pub/gnome/sources/java-gnome/
- ↑ For the current list of developers see AUTHORS
- ↑ java-gnome 4.0: About. Accessed 2009-08-31.
- ↑ COPYING file at the source repository
- ↑ libjava-gnome-java package