Swing. By Iqtidar Ali

Similar documents
Introduction p. 1 JFC Architecture p. 5 Introduction to JFC p. 7 The JFC 1.2 Extension p. 8 Swing p. 9 Drag and Drop p. 16 Accessibility p.

Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI

Java IDE Programming-I

Chapter 12 GUI Basics

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7

Swing UI. Powered by Pentalog. by Vlad Costel Ungureanu for Learn Stuff

Introduction to the JAVA UI classes Advanced HCI IAT351

Graphical User Interfaces. Swing. Jose Jesus García Rueda

Introduction to Graphical Interface Programming in Java. Introduction to AWT and Swing

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling

GUI Basics. Object Orientated Programming in Java. Benjamin Kenwright

GUI and its COmponent Textfield, Button & Label. By Iqtidar Ali

CS111: PROGRAMMING LANGUAGE II

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

Graphical User Interfaces (GUIs)

2110: GUIS: Graphical User Interfaces

MODEL UPDATES MANIPULATES USER

Contents Introduction 1

CS 251 Intermediate Programming GUIs: Components and Layout

Lecture 18 Java Graphics and GUIs

SD Module-1 Advanced JAVA

SD Module-1 Advanced JAVA. Assignment No. 4

Chapter 13 GUI Basics. Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved.

China Jiliang University Java. Programming in Java. Java Swing Programming. Java Web Applications, Helmut Dispert

Chapter 12 GUI Basics. Motivations. The design of the API for Java GUI programming

Part 3: Graphical User Interface (GUI) & Java Applets

CSE 331 Software Design & Implementation

CSE 331. Event- driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

CSE 331. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

Tool Kits, Swing. Overview. SMD158 Interactive Systems Spring Tool Kits in the Abstract. An overview of Swing/AWT

Starting Out with Java: From Control Structures Through Objects Sixth Edition

Week Chapter Assignment SD Technology Standards. 1,2, Review Knowledge Check JP3.1. Program 5.1. Program 5.1. Program 5.2. Program 5.2. Program 5.

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008

Graphics. Lecture 18 COP 3252 Summer June 6, 2017

Chapter 12 Advanced GUIs and Graphics

Chapter 17 Creating User Interfaces

JTcl and Swank. Bruce A. Johnson, Tom Poindexter, & Dan Bodoh. What s new with Tcl and Tk on the JVM. Wednesday, October 26, 11

Announcements. Introduction. Lecture 18 Java Graphics and GUIs. Announcements. CSE 331 Software Design and Implementation

Graphics programming. COM6516 Object Oriented Programming and Design Adam Funk (originally Kirill Bogdanov & Mark Stevenson)

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1

Unit 6: Graphical User Interface

Window Interfaces Using Swing Objects

Graphical User Interfaces. Comp 152

JBuilder 8.0 JFC and Swing Programming

Chapter 6: Graphical User Interfaces

Java Graphical User Interfaces

Widgets. Overview. Widget. Widgets Widget toolkits Lightweight vs. heavyweight widgets Swing Widget Demo

Graphical User Interface (GUI)

Systems Programming Graphical User Interfaces

2010 가을학기부산대학교정보컴퓨터공학부 OVERVIEW OF GUI PROGRAMMING

CSE 1325 Project Description

Learn Java Programming, Dr.Hashamdar. Getting Started with GUI Programming

Window Interfaces Using Swing Objects

user-friendly and easy to use.

Advanced Java Programming. Swing. Introduction to Swing. Swing libraries. Eran Werner, Tel-Aviv University Summer, 2005

CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming

Swing from A to Z Some Simple Components. Preface

Widgets. Widgets Widget Toolkits. 2.3 Widgets 1

Visit for more.

Packages: Putting Classes Together

Widgets. Widgets Widget Toolkits. User Interface Widget

Computer Science 210: Data Structures. Intro to Java Graphics

Lecture 5: Java Graphics

Introduction to GUIs. Principles of Software Construction: Objects, Design, and Concurrency. Jonathan Aldrich and Charlie Garrod Fall 2014

CS410G: GUI Programming. The Model/View/Controller Pattern. Model. Controller. View. MVC is a popular architecture for building GUIs

Example: CharCheck. That s It??! What do you imagine happens after main() finishes?

Supporting Materials

SELF-STUDY. Glossary

Graphical interfaces & event-driven programming

Index SELF-STUDY. Symbols

INTRODUCTION TO (GUIS)

Java: Graphical User Interfaces (GUI)

CSE 331 Software Design & Implementation

Contents Chapter 1 Introduction to Programming and the Java Language

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

14.2 Java s New Nimbus Look-and-Feel 551 Sample GUI: The SwingSet3 Demo Application As an example of a GUI, consider Fig. 14.1, which shows the SwingS

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling

CoSc Lab # 5 (The Controller)

Object-Oriented Programming: Revision. Revision / Graphics / Subversion. Ewan Klein. Inf1 :: 2008/09

core 2 Basic Swing GUI Controls in Java 2

core programming Basic Swing GUI Controls in Java Marty Hall, Larry Brown

Rizvi College of Arts, Science & Commerce Bandra (W), Mumbai Teaching Plan Academic Year

Summary Chapter 25 GUI Components: Part 2

Graphic User Interfaces. - GUI concepts - Swing - AWT

Graphical Applications

Java Swing Introduction

BASICS OF GRAPHICAL APPS

Java 11 Swing with Eclipse Index

Graphical User Interface (GUI)

Java 11 Swing Index. Section Title Page

Java 1.9 Swing Index

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science

Jonathan Aldrich Charlie Garrod

Chapter 4. Swing 18 marks

TTTK Program Design and Problem Solving Tutorial 3 (GUI & Event Handlings)

The Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC).

Java 1.8 Swing with Eclipse Oxygen Index

Java 1.8 Swing with Eclipse Mars Index

Java 1.8 Swing with Eclipse Neon Index

Transcription:

Swing By Iqtidar Ali

Background of Swing We have been looking at AWT (Abstract Window ToolKit) components up till now. Programmers were not comfortable when doing programming with AWT. Bcoz AWT is limited range. Has lots of Bugs. Takes up lots of System Resources.

Swing JAVA provides a rich set of libraries to create Graphical User Interface. Swing provides more features for programming. It added plenty of sophisticated components for programmers use. It takes less system resources. Swing has 4 times more components as AWT.

Swing Swing is a part of the java Foundation Classes (JFC) Library. JFC is an extension of the Abstract Window Toolkit (AWT). JFC provides improved functionality over the AWT. Like New Component, New Features in Existing Components, Better Event handling. Light Weight, Rich controls, Highly Customizable, Pluggable lookand-feel. The Swing GUI components have names beginning with the letter J e.g., JButton, JLabel etc.

Major Components of Swing As Swing is built on top of the AWT packages so Swing consist of a great number of pre-built classes. They have basically same name as that of AWT classes. The letter J has been added to it in beginning. E.g., JApplet, JButton, JCheckbox, JFrame, JLabel, JTree, etc.

GUI (Graphical User Interface) GUI is a visual interface to a program. GUI are built from GUI components. A GUI component is an object with which the user interacts via of mouse or keyboard. The java.awt or javax.swing package, Both these packages provide rich set of user interface component.

Java.awt packages AWT the Abstract Window Toolkit. It contains original GUI components that came with the first release of JDK. AWT components are called Heavy Weight Component as they rely on local platform. when AWT is created corresponding process on the O.S is created which make it heavy.

Javax.Swing packages These are the newest GUI components. As Swing components are written, manipulated and displayed completely in java. That s why its called pure java components. The swing components allow the programmer to specify a uniform look & feel across all platforms. Swing components are referred as light weight components. Several swing components are still HWC (Heavy Weight Component)

User Interface Every user interface considers the following three main aspects: UI elements : These are the core visual elements the user eventually sees and interacts with GWT provides a huge list of widely used and common elements varying from basic to complex. Layouts: They define how UI elements should be organized on the screen and provide a final look and feel to the GUI (Graphical User Interface). Behaviour: These are events which occur when the user interacts with UI elements. The behaviour part will be covered in Event Handling.

Java Swing class hierarchy

Component A Container is the abstract base class for the non menu user-interface controls of SWING. Component represents an object with graphical representation. Container A Container is a component that can contain other SWING components. JComponent A JComponent is a base class for all swing UI components. In order to use a swing component that inherits from JComponent. component must be in a containment hierarchy whose root is a top-level Swing container

SWING UI Elements: Following is the list of commonly used controls while designed GUI using SWING. Control & Description JLabel A JLabel object is a component for placing text in a container. Jbutton This class creates a labeled button. JColorChooser A JColorChooser provides a pane of controls designed to allow a user to manipulate and select a color. JCheck Box A JCheckBox is a graphical component that can be in either an on (true) or off (false) state. JRadioButton The JRadioButton class is a graphical component that can be in either an on (true) or off(false) state. in a group.

SWING UI Elements: Control & Description (Cont--) JList A JList component presents the user with a scrolling list of text items. JComboBox A JComboBox component presents the user with a to show up menu of choices. JTextField A JTextField object is a text component that allows for the editing of a single line of text. JPasswordField A JPasswordField object is a text component specialized for password entry. JTextArea, ImageIcon, Jscrollbar, JOptionPane, JFileChooser, JProgressBar, Jslider, JSpinner

THE END