TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Java Swing

Introduction to Java Swing API

Overview

In this tutorial, we will learn about Java Swing API. Java Swing API is a set of APIs that provides GUI(Graphical User Interface ) for Java programs. Java Swing is a part of Java Foundation Classes (JFC). JFC contains features for building Graphical User Interfaces.

Java Swing is developed based on AWT(Abstract Window Toolkit ) APIs.Swing provides more sophisticated GUI components than AWT. The AWT GUI components can be used from java.awt package.

 

Java Swing API

Swing Features

Swing provides various layout managers to arrange GUI components inside a container.

Swing offers various button types such as push-button, check box, radio button, etc

Swing provides various text components and dialog boxes.

Swing enables pluggable Look & Feel to allow Java applications to have look and feel independent from the underlying platform. This allows Swing GUI components to have a uniform Look-and-Feel for the Java application across all platforms. We can also customize the application to use the platform’s custom Look-and-Feel.

Swing Packages

We need to import the Swing components in the Java code. The entire package using the below statement:

import javax.swing.*;

Individual component classes like:

import javax.swing.JFrame;

 

Import Swing Statement

 

Some of the Swing packages are as follows:

Swing Package Description
javax.swing This package contains the core Swing components, including the model Interfaces and Helper classes.
javax.swing.event This package defines Listeners & Events which Swing components use to communicate asynchronously.

—

Java Tutorial on this website:

https://www.testingdocs.com/java-tutorial/

For more information on Java, visit the official website :

https://www.oracle.com/in/java/

Related Posts

Add GUI Components Swing

Java Swing /

Add GUI Components to a Swing Container

JPanel Container Class

Java Swing /

Swing JPanel Container Class

Swing CardLayout

Java Swing /

Java Swing CardLayout

Java Swing GridLayout

Java Swing /

Java Swing GridLayout

Java Swing FlowLayout

Java Swing /

Java Swing FlowLayout

› Create a button with Swing JButton

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version