Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the J in JFrame?

What is the 'J' in JFrame in Java?

like image 489
Joseph Avatar asked Dec 03 '22 10:12

Joseph


2 Answers

The J identifies all Swing components.

Swing used to be marketed as Java Foundation Classes, before it became an integral part of the JDK.

like image 139
Joachim Sauer Avatar answered Dec 05 '22 23:12

Joachim Sauer


Joachim Sauer's answer is correct. Read on only if you need more in depth overview of the various Java GUI approaches and evolution.

First Java GUI was (is) called AWT (Abstract Window Toolkit). AWT is a very simple tool kit with limited GUI components, layout managers, and events. An example of an AWT class is java.awt.Frame.

Then a more complex solution was developed by Sun -> JFC Swing (Java Foundation Classes, a.k.a. Swing). In Swing, Sun created a very well-engineered, flexible, powerful GUI tool kit. Unfortunately, this means Swing takes time to learn, and it is sometimes too complex for common situations. Swing is built on parts of AWT. All Swing parts are also AWT parts. Swing uses the AWT event model and support classes, such as Colors, Images, and Graphics. An example of a Swing class is javax.swing.JFrame. Here you see your "J" which prefixes all Swing GUI components.

SWT is a low-level GUI tool kit comparable in concept to AWT. JFace is a set of enhanced components and utility services to make building GUIs with SWT easier. The builders of SWT learned from the AWT and Swing implementations and tried to build a system that had the advantages of both without their disadvantages. In many ways, they succeeded.

Note that both, AWT and Swing, are part of the J2SE package. While SWT is a separate third-party library which grew up with the Eclipse IDE (org.eclipse.swt).

This overview was taken from http://www.ibm.com/developerworks/grid/library/os-swingswt. See that link for more detail.

like image 24
Jiri Patera Avatar answered Dec 05 '22 23:12

Jiri Patera