INTRODUCTION OF SWING

Introduction of Swing


What is Swings in java ?

  • A part of The JFC

  • Swing Java consists of Look and feel, Accessibility ,Java 2D,Drag and Drop, etc

Swing Model/view design:

  • The “view part” of the MV design is implemented with a component object and the UI object. The “model part” of the MV design is implemented by a model object and a change listener object.

  • Swing is built on top of AWT and is entirely written in Java, using AWT’s lightweight component support. In particular, unlike AWT, the architecture of Swing components makes it easy to customize both their appearance and behavior.

  • Components from AWT and Swing can be mixed, allowing you to add Swing support to existing AWT-based programs. For example, swing components such as JSlider, JButton, JRadiobutton,JMenu,JCheckbox could be used in the same program with standard. Swing also has the ability to replace these objects on-the-fly.

  • 100% Java implementation of components

  • Pluggable Look & Feel

  • Lightweight components

  • Uses MVC Architecture

    (M) Model represents the data

    (V) View as a visual representation of the data

    (C) Controller takes input and translates it to changes in data

Java Swing class hierarchy

    The class JComponent, descended directly from Container, is the root class for most of Swing’s user interface components.

    Naming Convention
    Swing-hierachy