JFace is defined by the Eclipse project as "a UI toolkit that provides helper classes for developing UI features that can be tedious to implement."[1] The Standard 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.
![]() The Eclipse IDE, a JFace-based application | |
Developer(s) | Eclipse Foundation |
---|---|
Stable release | 3.9.1 / July 25, 2013 |
Repository | |
Operating system | Cross-platform |
Available in | Multilingual |
Type | widget toolkit for the Java platform |
License | Eclipse Public License |
Website | wiki |
Structure
It is a layer that sits on top of the raw widget system, and provides classes for handling common UI programming tasks. It brings model view controller programming to the Standard Widget Toolkit.
- Provides Viewer classes that handle the tedious tasks of populating, sorting, filtering, and updating widgets
- Provides Actions to allow users to define their own behavior and to assign that behavior to specific components, e.g. menu items, tool items, push buttons, etc.
- Provides registries that hold Images and Fonts
- Defines standard dialogs and wizards, and defines a framework for building complex interactions with the user
- Its primary goal is to free the developer up, letting the developer focus on the implementation of his or her specific application without having to be concerned with the underlying widget system or solving problems that are common in almost all UI applications.
- A primary concern of the Eclipse group when developing JFace was that under no circumstances did they want to hide the SWT component implementation from the programmer. JFace is completely dependent on SWT, but SWT is not dependent on JFace. Furthermore, the Eclipse Workbench is built on both JFace and SWT; in some instances, it bypasses JFace and accesses SWT directly.
Example
The following is a basic Hello World program using JFace.
import org.eclipse.jface.window.ApplicationWindow;import org.eclipse.swt.SWT;import org.eclipse.swt.widgets.*;public class HelloWorld extends ApplicationWindow { public static void main(String[] args) { new HelloWorld().run(); } public HelloWorld() { super(null); } public void run() { setBlockOnOpen(true); open(); Display.getCurrent().dispose(); } protected Control createContents(Composite parent) { Label label = new Label(parent, SWT.CENTER); label.setText("Hello, World"); return label; }}
See also
References
Bibliography
External links
- Wiki JFace
- Sam-bodden, Brian; Judd, Christopher (April 26, 2004). "Rich clients with the SWT and JFace". JavaWorld. Retrieved 2020-07-21.
- Using the Eclipse GUI outside the Eclipse Workbench, Part 1: Using JFace and SWT in stand-alone mode, by Adrian Emmenis
- Using the Eclipse GUI outside the Eclipse Workbench, Part 2: Using the JFace image registry, by Adrian Emmenis
🔥 Top keywords: Main PageSpecial:SearchPage 3Wikipedia:Featured picturesHouse of the DragonUEFA Euro 2024Bryson DeChambeauJuneteenthInside Out 2Eid al-AdhaCleopatraDeaths in 2024Merrily We Roll Along (musical)Jonathan GroffJude Bellingham.xxx77th Tony AwardsBridgertonGary PlauchéKylian MbappéDaniel RadcliffeUEFA European Championship2024 ICC Men's T20 World CupUnit 731The Boys (TV series)Rory McIlroyN'Golo KantéUEFA Euro 2020YouTubeRomelu LukakuOpinion polling for the 2024 United Kingdom general electionThe Boys season 4Romania national football teamNicola CoughlanStereophonic (play)Gene WilderErin DarkeAntoine GriezmannProject 2025