Skip to content

Instantly share code, notes, and snippets.

@resarahadian
Created January 15, 2014 00:00
Show Gist options
  • Save resarahadian/8428368 to your computer and use it in GitHub Desktop.
Save resarahadian/8428368 to your computer and use it in GitHub Desktop.
Simple Frame Java Gnome
import org.gnome.gtk.Gtk;
import org.gnome.gtk.Stock;
import org.gnome.gtk.ToolButton;
import org.gnome.gtk.Toolbar;
import org.gnome.gtk.VBox;
import org.gnome.gtk.Window;
import org.gnome.gtk.WindowPosition;
public class frameJavaGnome extends Window {
public frameJavaGnome() {
setTitle("Simple Frame Java Gnome");
initComponent();
setDefaultSize(800, 600);
setPosition(WindowPosition.CENTER);
showAll();
}
public void initComponent() {
Toolbar toolbar = new Toolbar();
ToolButton tabBaru = new ToolButton(Stock.NEW);
ToolButton tabBuka = new ToolButton(Stock.OPEN);
ToolButton tabSimpan = new ToolButton(Stock.SAVE);
toolbar.insert(tabBaru, 0);
toolbar.insert(tabBuka, 1);
toolbar.insert(tabSimpan, 2);
VBox vbox = new VBox(false, 2);
vbox.packStart(toolbar, false, false, 0);
add(vbox);
}
public static void main(String[] args) {
Gtk.init(args);
new frameJavaGnome();
Gtk.main();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment