![]() The Eclipse IDE, a JFace-based application | |
Developer(s) | Eclipse Foundation |
---|---|
Stable release | 3.9.1 / July 25, 2013 (2013-07-25) |
Repository | |
Operating system | Cross-platform |
Available in | Multilingual |
Type | widget toolkit for theJava platform |
License | Eclipse Public License |
Website | wiki |
This articlerelies excessively onreferences toprimary sources. Please improve this article by addingsecondary or tertiary sources. Find sources: "JFace" – news ·newspapers ·books ·scholar ·JSTOR(April 2009) (Learn how and when to remove this message) |
JFace is defined by theEclipse project as "aUItoolkit that provides helperclasses for developing UI features that can be tedious to implement."[1] TheStandard Widget Toolkit (SWT) is an open source widget toolkit for Java designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented.
It is a layer that sits on top of the rawwidget system, and provides classes for handling common UI programming tasks. It bringsmodel view controller programming to theStandard Widget Toolkit.
The following is a basicHello World program using JFace.
importorg.eclipse.jface.window.ApplicationWindow;importorg.eclipse.swt.SWT;importorg.eclipse.swt.widgets.*;publicclassHelloWorldextendsApplicationWindow{publicstaticvoidmain(String[]args){newHelloWorld().run();}publicHelloWorld(){super(null);}publicvoidrun(){setBlockOnOpen(true);open();Display.getCurrent().dispose();}protectedControlcreateContents(Compositeparent){Labellabel=newLabel(parent,SWT.CENTER);label.setText("Hello, World");returnlabel;}}