A visual representation of communication presented to the user for easy interaction with the machine.
JAVA GUI
It provides a rich set of libraries to create Graphical User Interface in a platform independent way.
Java Foundation Classes
What does JFC stands for?
Java Foundation Classes(JFC)
Encompass a group of features for building graphical user interfaces (GUIs) and adding rich graphics functionality and interactivity to Java applications.
Java's platform-independent windowing, graphics, and user-interface widget toolkit part of the Java Foundation Classes (JFC).
JavaAWT
The standard API (Application Program Interface) for providing graphical user interfaces for Java programs contains the fundamental classes used for constructing GUIs.
Application Program Interface
What does API stands for?
JavaSwing
A graphical user interface toolkit in Java,
which is one part of the Java Foundation Classes (JFC).
JavaSwing
Includes graphical user interface (GUI) widgets such as text boxes, buttons, split-panes, and tables
Java Swing
Runs the same on all platforms.
JavaSwing
Supports pluggable look and feel - not by using the native platform's facilities, but by roughly emulating them.
JavaSwing
Classes are often described as lightweight because they do not require allocation of native resources in the operating system's window toolkit.
JavaSwing
UI elements such as dialog boxes and buttons; you can usually recognize their names because they begin with J
JavaSwing
Each Swing component is a descendant of a JComponent, which in turn inherits from the java.awt.Containerclass
importjavax.swing.*;
What is the Java Swing import statement?
AWT
- Platform Dependent
- Heavyweight
- Does not follow MVC
- Lesser Components
- Doesn't support pluggable look and feel
Swing
- Platform Independent
- Lightweight
- Follows MVC
- More powerful components
- Supports pluggable look and feel
JOptionPane Class
This class is used to provide standard dialog boxes.
Dialog Boxes
Used to display information or get input from the user.
importjavax.swing.JOptionPane;
Tells the compiler where to find the JOptionPane class.
Component
It is an abstract class.
Component
It is responsible for remembering the current foreground and background colors and the currently selected text font.
Container
A subclass of component class.
Container
A component in AWT that can contain another components like buttons, textfields, labels etc.
Component
In order to place every component in a particular position on a screen, we need to add them to a container.
Window
This class has no border and no title.
Dialog
It has border and title. This class cannot exist without an associated instance of the Frame class.
Frame
It has title, border and menu bars. It can contain several components like buttons, text fields, scrollbars etc. This is most widely used container while developing an application in AWT.
Panel
It does not contain title bar, menu bar or border. It is a generic container for holding components. An instance of the Panel class provides a container to which to add components.
Button
Allows the developer to create a _____ with an appropriate label on it. It also provides a way to define functionality after clicking the button.
List
It is used to display a list of required items. Using this class, the user can select one or multiple items in it
Checkbox
It can be used when an application wants the user to choose from either true or false.
Label
It provides descriptive text information on the application window. It is placed inside a container