Swing / Session1 / 1 of 30 Module Introduction Distributed Computing in Java.

Slides:



Advertisements
Similar presentations
Components and Containers
Advertisements

Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 17 Creating User Interfaces.
Building Applications Dialogs Passing data between windows Validating Input using FocusListeners.
Fall 2007CS 225 Graphical User Interfaces Event Handling Appendix C.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
1 Chapter 7 Graphics and Event Handling. 2 Overview The java.awt and javax.swing packages and their subpackages support graphics and event handling. Many.
Event Handling Events and Listeners Timers and Animation.
© The McGraw-Hill Companies, 2006 Chapter 18 Advanced graphics programming.
Graphical User Interfaces (GUIs) GUI: An application that uses graphical objects to interact with users GUI applications consist of: –Events: A user or.
Creating a GUI with Swing. Introduction Very useful link: Swing – is a part of JFC (Java Foundation.
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Graphical User Interface Components: Part 1
CC1007NI: Further Programming Week 5 Dhruba Sen Module Leader (Islington College)
PROGRAMMING REVIEW Lab 2 EECS 448 Dr Fengjun Li and Meenakshi Mishra.
Chapter 13 Advanced GUIs and Graphics. Chapter Objectives Learn about applets Explore the class Graphics Learn about the class Font Explore the class.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 12 Advanced GUIs and Graphics.
Java Swing, Events and MVC Optional Readings: Eckel’s Thinking in Java: Chap 14 (
Graphical User Interfaces (GUIs) GUI: An application that uses graphical objects to interact with users GUI applications consist of: –Events: A user or.
Object Oriented Programming Ders 11: Interfaces Mustafa Emre İlal
MIT AITI 2003 Lecture 17. Swing - Part II. The Java Event Model Up until now, we have focused on GUI's to present information (with one exception) Up.
3461A Readings from the Swing Tutorial. 3461A Overview  The follow is the Table of Contents from the trail “Creating a GUI with JFC/Swing” in the “The.
Chapter 9: Visual Programming Basics Object-Oriented Program Development Using Java: A Class-Centered Approach.
Ch 3-4: GUI Basics Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: GUI Components.
1 Outline 1 Introduction 2 Overview of Swing Components 3 JLabel 4 Event Handling 5 TextFields 6 How Event Handling Works 7 JButton 8 JCheckBox and JRadioButton.
Java Programming: Advanced Topics 1 Components and Facilities for Rich Graphical User Interfaces Chapter 7.
An Introduction to Programming and Object Oriented Design using Java 3 rd Edition. Dec 2007 Jaime Niño Frederick Hosch Chapter 18 Integrating user interface.
1 Java Swing - Lecture 2 Components and Containment Boriana Koleva
Object Oriented Programming Engr. M. Fahad Khan Lecturer, Software Engineering Department University of Engineering & Technology, Taxila.
Chapter 12Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Announcements/Reminders l Next week: »No Lectures »No Labs »Recitation.
CS Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /20/2015 GUI - Graphical User Interface.
Programming with Java’s Swing API February 4, 2003 CMPS Advanced Programming Graphical User Interfaces.
1 / 67 COP 3503 FALL 2012 SHAYAN JAVED LECTURE 14 Programming Fundamentals using Java 1.
1 Java GUIs Dr. Randy M. Kaplan. 2 Constructing User Interfaces From a functionality standpoint there are two things that every program must implement.
CHAPTER:07 JAVA IDE PROGRAMMING-II Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Java GUI. Graphical User Interface (GUI) a list a button a text field a label combo box checkbox.
Introduction to GUI in 1 Graphical User Interface 2 Nouf Almunyif.
Agenda Introduction. Event Model. Creating GUI Application. Event Examples.
Java GUI. Overview The ”idea” The ”idea” The Components The Components Listeners Listeners The Program The Program Interface Eventlistener Interface Eventlistener.
GUIs Graphical User Interfaces. Everything coming together Known: – Inheritance – Interfaces – Abstract classes – Polymorphism – Exceptions New: – Events.
Swinging in Your Java Playground. Background Swing is a part of the Java Foundation Classes (JFC). The JFC is made up of features intended to give a programmer.
Swing - 2 Session 13. Swing - 2 / 2 of 38 Objectives (1) Discuss trees and tables Discuss progress bars Discuss MVC architecture Describe menus.
5-Jan-16 R Ramesh Swing. 5-Jan-16 R Ramesh An Introduction to Java Foundation Classes (JFC) A suite of libraries to assist programmers create enterprise.
Graphical User Interface Components: Part 1 Chapter 11.
Graphical User Interfaces are Trees CS1316: Representing Structure and Behavior.
Ajmer Singh PGT(IP) JAVA IDE Programming - I. Ajmer Singh PGT(IP) GUI (Graphical User Interface) It is an interface that uses a graphic entities along.
Java GUI COMP 401 Fall 2014 Lecture 16 10/20/2014.
Chapter 14: Introduction to Swing Components. Objectives Understand Swing components Use the JFrame class Use the JLabel class Use a layout manager Extend.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
Java Swing, Events Readings: Just Java 2: Chap 19 & 21, or Eckel’s Thinking in Java: Chap 14 Slide credits to CMPUT 301, Department of Computing Science.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Java Swing. Graphical User Interfaces (GUIs) GUI: An application that uses graphical objects to interact with users GUI applications consist of: – Events:
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
1 A Quick Java Swing Tutorial. 2 Introduction Swing – A set of GUI classes –Part of the Java's standard library –Much better than the previous library:
Java Programming Fifth Edition Chapter 13 Introduction to Swing Components.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
Java Swing What is swing? Swing is a ”Lightweight” GUI ToolKit for Java Different from AWT / SWT Toolkits for GUIs Few lines of code to produce GUI elements.
A Quick Java Swing Tutorial
Welcome To java
A First Look at GUI Applications
A Quick Java Swing Tutorial
Graphical User Interface (GUI) Components: Part 1 Java How to Program, 9 th Edition Chapter 14.
Ellen Walker Hiram College
Chapter 13: Advanced GUIs and Graphics
Event Driven Programming and Graphical User Interface
A Quick Java Swing Tutorial
Chapter 17 Creating User Interfaces
Chapter 17 Creating User Interfaces
Advanced GUIs and Graphics
Java GUI programming with Swing
Presentation transcript:

Swing / Session1 / 1 of 30 Module Introduction Distributed Computing in Java

Session 1 Module 1: Introduction to SWING Module 2: Swing Components and Dialogs

Swing / Session1 / 3 of 30 Module 1: Introduction to SWING  Objectives

Swing / Session1 / 4 of Introduction How to create this interface?

Swing / Session1 / 5 of 30 JFC in NetBeans

Swing / Session1 / 6 of 30 AWT  Support Application, Applet programming

Swing / Session1 / 7 of 30 AWT

Swing / Session1 / 8 of 30 Benefits of swing Swing components are lightweight as compared to AWT components. Swing allows Pluggable-Look-And Feel control. Borders drawn around most of the Swing components can be changed. Appearance of Swing components can be changed by either invoking methods on it, or by creating a subclass of it. Swing components don’t have to be rectangle (buttons can be round) Swing is based on the Model-View-Controller Architecture.

Swing / Session1 / 9 of 30 Model-View-Controller Architecture  Code to maintain data.  Code to represent graphics  Code to control user interaction.

Swing / Session1 / 10 of 30 Containers 4 parts of a root pane: Glass pane Layered pane Menu bar Content pane

Swing / Session1 / 11 of 30 Top-Level container:Class JFrame

Swing / Session1 / 12 of 30 Top-Level container: Class JApplet

Swing / Session1 / 13 of 30 General purpose container: JPanel Intermediate container. General-purpose container for lightweight components Groups some related lightweight components.

Swing / Session1 / 14 of 30 Lightweight Components JLabelJTextFiels JTextArea JRadioButton JButton JCheckBox JPasswordField

Swing / Session1 / 15 of 30 Lightweight Components: Event handling Event handling in NetBeans

Swing / Session1 / 16 of 30 Lightweight Components: Event handling ObjectEventInterfaceMethod JButtonActionEventActionListeneractionPerformed() JCheckBoxActionEvent ItemEvent ActionListener ItemListener actionPerformed() itemStateChanged() JRadioButtonActionEvent ItemEvent ActionListener ItemListener actionPerformed() itemStateChanged() JTextField JTextArea ActionEvent FocusEvent ActionListener FocusListener actionPerformed() focusGained(), focusLost() JPasswordFieldActionEventActionListeneractionPerformed()

Swing / Session1 / 17 of 30 Module 1 Summary

Swing / Session1 / 18 of 30 Module 2: Swing Components and Dialogs  Objectives:

Swing / Session1 / 19 of 30 JScrollPane class  Provide a scrollable view of a component Parts of a scrollpane

Swing / Session1 / 20 of 30 JSlider class Event handling: java.swing.event.ChangeEvent ChangeListener public void stateChanged(ChangeEvent e)

Swing / Session1 / 21 of 30 javax.swing.Timer class  To perform a task once, after a delay. For example, the tool tip manager uses Swing timers to determine when to show a tool tip and when to hide it.  To perform a task repeatedly. For example, you might perform animation or update a component that displays progress toward a goal.  Constructors: Timer ( int miliSecDelay, ActionListener listener)  Common used methods

Swing / Session1 / 22 of 30 javax.swing.JProgressBar class  A Progress bar is used to display the progess of a time consuming operation.  A Timer is used to determine the amount of task completed and accordingly update the progress bar Constructors Common methods Event handling ChangeListener interface public void stateChanged(…)

Swing / Session1 / 23 of 30 javax.swing.JFormattedTextFi eld class Create number formatted textfield Create date formatted textfield Create customized format java.text.DateFormat java.text.NumberFormat javax.swing.text.MaskFormatter

Swing / Session1 / 24 of 30 javax.swing.JEditorPane class

Swing / Session1 / 25 of 30 javax.swing.JTextPane class

Swing / Session1 / 26 of 30 Dialog box  Types of Dialog boxes: Modal dialog boxes Non-modal dialog boxes Pre-defined standard dialog boxes: JOptionPane class. ProgressMonitor class JColorChooser class JFileChooser class Create custom dialogs, use the JDialog class directly.

Swing / Session1 / 27 of 30 javax.swing.JOptionPane class title message icon buttons

Swing / Session1 / 28 of 30 JOptionPane class

Swing / Session1 / 29 of 30 javax.swing.JDialog class

Swing / Session1 / 30 of 30 Module 2 Summary