Jump to content

java-gnome

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ScotXW (talk | contribs) at 07:14, 15 July 2014. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
java-gnome
Stable release
4.1.3[1] / May 5, 2013 (2013-05-05)
Repository
Written inC and Java
Operating systemUNIX-like
TypeGUI language bindings for java
LicenseGNU General Public License with exception.
Websitejava-gnome.sourceforge.net

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 in the classpath the jar gtk-4.1.jar, it's disponibile on Debian (and all Debian-based distributions) on package libjava-gnome-java[5] on official repositories (the jar is installed on path \usr\share\java\).

java-gnome GtkExample
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(new Window.DeleteEvent() {
      public boolean onDeleteEvent(Widget source, Event 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

  1. ^ http://ftp.gnome.org/pub/gnome/sources/java-gnome/
  2. ^ For the current list of developers see AUTHORS
  3. ^ java-gnome 4.0: About. Accessed 2009-08-31.
  4. ^ COPYING file at the source repository
  5. ^ libjava-gnome-java package