

The size of the frame includes any area designated for the border.įrame encapsulates a window. JFrameĪ Frame is a top-level window with a title and a border. JPanel class covers the entire space or a window where we attach the component to visualize it along with other panels. In the example above, we declared a button as the variable name, JButton as the name of the class that holds the button component in the AWT package, and Login as the text that appears on the button. Variables also hold GUI components like labels, checkboxes, text fields, frames, panels, and buttons.

In this tutorial, we will learn how to design a simple user login page like this: It provides a better and richer set of GUI components with native or cross-platform accessibility that makes the application look the same on different windows. Swing: Swing is a set of APIs containing GUI components used for creating Applications.

Since then, Swing has remained the primary Java GUI technology.Ībstract Window Toolkit (AWT): AWT is a set of APIs used to create a GUI for Java applications. Later, it was replaced by Swing in Java SE 1.2. Java’s original GUI library was called Abstract Window Toolkit (AWT). Components such as labels, text fields, buttons, checkbox, JPanel, JFrame on the screen. GUIs offer a visual display of components. Java provides a rich set of libraries to create GUIs in a platform-independent way. In this article, we will learn how to build a simple GUI using Java. Graphical User Interfaces were introduced in reaction to the perceived steep learning curve of Command-Line Interfaces (CLIs).
