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

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com