Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming
Advertisements

14 Copyright © 2005, Oracle. All rights reserved. User Interface Design: Swing Basics Planning the Application Layout.
Introduction to Swing Components Chapter 14. Part of the Java Foundation Classes (JFC) Provides a rich set of GUI components Used to create a Java program.
User Interface Design CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Unit 091 Introduction to GUI Programming Introduction to User Interfaces Introduction to GUI Programming GUI Design Issues GUI Programming Issues Java.
Understanding SWING Architecture CS 4170 UI Design Hrvoje Benko Oct. 9, 2001.
Lecture 15 Graphical User Interfaces (GUI’s). Objectives Provide a general set of concepts for GUI’s Layout manager GUI components GUI Design Guidelines.
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.
Unit 111 Java GUI Components and Events  Learning Outcomes oDistinguish between GUI components and containers. oIdentify and distinguish top-level containers.
1 GUI Elements in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CPSC150 Week 12 Graphical User Interfaces Chapter 11.
GUI Programming in Java Tim McKenna GUI Programming Concepts l conventional programming: sequence of operations is determined by the program.
Graphic User Interfaces Part 1. Typical GUI Screen from Microsoft Word What GUI “components” can you see? –Menus? Buttons? Labels? What else? –Anything.
A.k.a. GUI’s.  If you want to discuss your Lab 2 grade come see me this week. ◦ Office: 436 ERB. One hour prior to class ◦ Open to Appointments MWF 
GUI Programming in Java
Swing part-one Eriq Muhammad Adams J
DAT602 Database Application Development Lecture 6 JAVA Swing.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
CS377A: A Programming Approach to HCI Jan Borchers Spring Swing Refresher David Merrill 5/14/2002
Object Oriented Programming Ders 11: Interfaces Mustafa Emre İlal
Java GUI CSCE 190 – Java Instructor: Joel Gompert Mon, July 26, 2004.
Lab 6: Shapes & Picture Extended Ellipse & Rectangle Classes Stand-Alone GUI Applications.
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.
Introduction to Swing Components Chapter 14.  Part of the Java Foundation Classes (JFC)  Provides a rich set of GUI components  Used to create a Java.
Java Programming: Advanced Topics 1 Common Elements of Graphical User Interfaces Chapter 6.
10/24/20151 Java GUI Programming. 10/24/20152 What is a GUI? Java has standard packages for creating custom Graphical User Interfaces Some of the fundamental.
Dale Roberts GUI Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Chapter 9: Visual Programming Basics Object-Oriented Program Development Using Java: A Class-Centered Approach.
GUIs in Java Swing, Events CS2110, SW Development Methods Readings: MSD, Chapter 12 Lab Exercise.
Ch 3-4: GUI Basics Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: GUI Components.
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
1 Graphical User Interfaces AWT and Swing packages Frames and Panels Components Nested Panels Images Reading for this Lecture: L&L, 3.9 – 3.11.
CS Lecture 00 Swing overview and introduction Lynda Thomas
Java Programming: Advanced Topics 1 Components and Facilities for Rich Graphical User Interfaces Chapter 7.
SWING 101. IF YOU GET LOST - IMPORTANT LINKS  Swing articles:
1 Java Swing - Lecture 2 Components and Containment Boriana Koleva
Chapter 12Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Announcements/Reminders l Next week: »No Lectures »No Labs »Recitation.
CSCI Swing1 The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness –The Abstract.
Applets and Frames. Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L14: GUI Slide 2 Applets Usually.
CS Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /20/2015 GUI - Graphical User Interface.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Creating Windows. How can we use Java to create programs that use windows (GUI applications)? How can we use Java to create programs that use windows.
IM103 week 11 Part 2 P532 Case Study part 2: the Airport GUI Learning objectives By the end of this lecture you should be able to:  use the JTabbedPane.
Java GUI. Graphical User Interface (GUI) a list a button a text field a label combo box checkbox.
Ch13 Creating windows and applets. Short overview AWT (Abstract Windowing Toolkit) Early Java development used graphic classesEarly Java development used.
GUIs Graphical User Interfaces. Everything coming together Known: – Inheritance – Interfaces – Abstract classes – Polymorphism – Exceptions New: – Events.
Swing. Introduction to Swing What is Swing? “ Swing is a diverse collection of lightweight components that can be used to build sophisticated user interfaces.”
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.
Outline Creating Objects The String Class The Random and Math Classes Formatting Output Enumerated Types Wrapper Classes Components and Containers Images.
Basics of GUI Programming Chapter 11 and Chapter 22.
Creating a Window. A basic window in Java is represented by an object of the class Window in the package java.awt.
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 Programming, Second Edition Chapter Thirteen Understanding Swing Components.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
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.
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.
Welcome To java
Provision for GUIs in Java
A First Look at GUI Applications
University of Central Florida COP 3330 Object Oriented Programming
Provision for GUIs in Java
Lecture 27 Creating Custom GUIs
Swing & the JFC – Advanced Java GUI
Building Graphical User Interface with Swing a short introduction
Week 8 Swing NetBeans GUI Builder
TA: Nouf Al-Harbi NoufNaief.net :::
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

Introduction to Swing Mr. Crone

What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface

Swing Components Swing classes can be used to create the following: buttons text fields scroll bars check boxes radio buttons tables

Swing History Before Swing, Java had an original set of classes used for creating GUI’s This set of classes was known as AWT (Abstract Window Toolkit) The AWT was replaced by swing because of problems involving the use of GUI’s on different operating systems

Goal of Java Perhaps one of the main goals of the Java programming language was to be able to write code that could be used on any operating system The use of AWT created a conflict with this goal GUI’s created using AWT would look, or even act, different depending upon what operating system was used

The JFC JFC stands for Java Foundation Classes The JFC is a set of pre-made classes that can be used in project development Main parts of the JFC include: AWT Java 2D Drag and Drop Swing was added to the JFC in 1997 **Note: Swing did not replace AWT, but built upon its features

Components and Containers A swing GUI consists of two key items: Components Containers Component – an independent visual control such as a push button or slider Container – used to hold several components **Note: A container is really a component designed to hold other components

Components All component classes begin with the letter “J” Jframe Jlist JProgressBar JScrollBar JTextArea JToolBar Jmenu etc. All Swing components can be found within the javax.swing package

Containers Containers can contain other Containers Containers contain other containers can be listed in a hierarchy Top Level Containers: JFrame JApplet JWindow JDialog **As the name implies, top-level containers should be used at the top of the container hierarchy

Top-Level Containers A top-level container cannot be contained within any other container Every containment hierarchy must begin with a top-level container The most commonly used top-level container is JFrame The JApplet container is used in the creation of applets

Lightweight Containers Lightweight Containers can be placed in the container hierarchy below top-level containers Light weight containers are used to organize and manage groups of related components Examples: JPanel JRootPane Use lightweight containers to create subgroups of related controls

Panes Each top-level container defines a set of panes JRootPane is at the top of the pane hierarchy JRootPane is used to manage all other panes and is comprised of the following: Glass pane Content Pane Layered Pane **The content pane is the pane which you will add visual components to