A Sample User Interface
A Sample User Interface
A Sample User Interface
Introduction
• Contains the classes for creating user interfaces and for painting
graphics and images .
• Java AWT and Java Swing are both part of a group of Java class
libraries called the Java Foundation Classes (JFC).
• All class names in the swing package begin with a capital letter ‘J’.
JFC is short for Java Foundation Classes, which encompass a group of features for building
graphical user interfaces (GUIs) and adding rich graphics functionality and interactivity to Java
applications.
The Swing API is powerful, flexible — and immense. The Swing API has 18 public
packages:
Container
JComponent Window
Frame
JFrame
Component
• A component is an object having a graphical
representation that can be displayed on the screen and
that can interact with the user. Examples of components
are the buttons, checkboxes, and scrollbars of a typical
graphical user interface.
• JTextField()
• JTextField(int cols)
• JTextField(String s, int cols)
• JTextField(String s)