COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 32 – Java Graphical User Interfaces (GUIs) Webpage:

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming
Advertisements

User Interfaces II GUI – Awt, Swing, Web
Review Text Material Covered –Culwin: Chapter 8 threads –Johnson: Chapters 9, 10, 1 through p.44 –Swing: Chapter 1-15 Lessons Learned –Concepts of concurrency/synchronization.
Java GUI building with the AWT. AWT (Abstract Window Toolkit) Present in all Java implementations Described in (almost) every Java textbook Adequate for.
Basic Java – Interface design. Understand: How to use TextPad for Java How to define classes and objects How to create a GUI interface How event-driven.
Graphical User Interfaces (Part IV)
Java Software Development Paradigm Lecture # 12. Basics of GUI.
Unit 3 Graphical User Interface (GUI) Dr. Magdi AMER.
Graphic User Interfaces Layout Managers Event Handling.
Things to mention public static void main(String [] args) –The starting point for a free-standing Java application (i.e. one not run from the DrJava interactions.
Introduction to Java Classes, events, GUI’s. Understand: How to use TextPad How to define a class or object How to create a GUI interface How event-driven.
JAVA API (GUI) Subject:T0934 / Multimedia Programming Foundation Session:1 Tahun:2009 Versi:1/0.
Corresponds with Chapter 12
Unit 091 Introduction to GUI Programming Introduction to User Interfaces Introduction to GUI Programming GUI Design Issues GUI Programming Issues Java.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
CSE 115 Week 5 February , Monday Announcements Exam 3 today Exam 3 today Lab 3 due this week Lab 3 due this week Exam 4 Monday 2/18 Exam.
Lecture 15 Graphical User Interfaces (GUI’s). Objectives Provide a general set of concepts for GUI’s Layout manager GUI components GUI Design Guidelines.
1 Event Driven Programming with Graphical User Interfaces (GUIs) A Crash Course © Rick Mercer.
CS3157 Java UI Recitation. Material Covered: Overview of AWT components, Event Handling, creating applets, and sample UI. Not covered in recitation: Drawing,
1 GUI Elements in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
10.1 AWT The AWT classes Users today expect a Graphical User Interface (GUI) Improves application usability Difficult to implement cross-platform.
Chapter 6: Graphical User Interface (GUI) and Object-Oriented Design (OOD) J ava P rogramming: Program Design Including Data Structures Program Design.
Java Programming Chapter 10 Graphical User Interfaces.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 13 – Having Fun with Arrays in Java Webpage:
Java Programming: From Problem Analysis to Program Design, Second Edition1  Learn about basic GUI components.  Explore how the GUI components JFrame,
Applets and Frames CS 21a: Introduction to Computing I First Semester,
Introduction to GUI in Java 1. Graphical User Interface Java is equipped with many powerful,easy to use GUI component such as input and output dialog.
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.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
Copyright © 2002, Systems and Computer Engineering, Carleton University c-Gui3.ppt * Object-Oriented Software Development Part 18-c Building.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 35 – Overview of Java Web Programming Webpage:
ITEC 109 Lecture 27 GUI. GUIs Review Sounds –Arrays hold sample values –Creating a keyboard –Sound effects Homework 3 –The big two –Due after break –Lab.
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.
Applets Yong Choi School of Business CSU, Bakersfield.
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.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
CS1054: Lecture 21 - Graphical User Interface. Graphical User Interfaces vs. Text User Interface.
Field Trip #22 Creating an Excel Spreadsheet with Java By Keith Lynn.
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.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
GUIs Graphical User Interfaces. Everything coming together Known: – Inheritance – Interfaces – Abstract classes – Polymorphism – Exceptions New: – Events.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 11 – How to Get Started on Assignment #2 Webpage:
Java Programming: From Problem Analysis to Program Design, Second Edition1 Lecture 5 Objectives  Learn about basic GUI components.  Explore how the GUI.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 20 – Inheritance and Polymorphism in Java Webpage:
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 39 – Command Line Args & Recursion Webpage:
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Graphical User Interface (GUI)
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Introduction to GUI in 1 Graphical User Interface 3 Nouf Almunyif.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 14 – How to Complete Assignment 2, Part III Webpage:
Introduction to GUI Programming in Java: Frames, Simple Components, and Layouts.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
Notes for Assignment #2 Assn2: GUI Database Interface Corresponds with Chapters 28, 29, 31.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Event-Driven Programming and Basic GUI Objects.
COP2800 – Computer Programming Using JAVA
Java GUI.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Java Programming: From Problem Analysis to Program Design,
Ellen Walker Hiram College
Chapter 14 JavaFX Basics Dr. Clincy - Lecture.
CiS 260: App Dev I Chapter 6: GUI and OOD.
Graphical User Interface
TA: Nouf Al-Harbi NoufNaief.net :::
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 32 – Java Graphical User Interfaces (GUIs) Webpage:

COP2800 – Programming in JAVA Course Objectives – Basic Knowledge of Computers & Programming – Specific Knowledge of JAVA Programming – Practical Programming Projects Build Skills Today’s Class – Overview of GUIs – Java Code for a Simple GUI Making the Components Integrating Components into a GUI

Review: Java Program Structure HIGH-LEVEL VIEW JAVA Units: -Packages -Classes (Instances) -Methods -Instructions -Variables PICTURE CREDIT:

Review: Java Package Structure PICTURE CREDIT:

What is a GUI? G U I Graphical User Interface

Anatomy of a GUI FRAME TITLE BAR COP2800-S13-L32-Java-IntroGUIs File Edit View Insert View TOP BAR Text Box Shapes Object … : PULL-DOWN MENU CANVAS - or – PANEL - or – PANE SCROLL BAR BUTTON

Let’s Build a Simple GUI: 1. Make a frame 2. Set up the content panel 3. Make our components and put in panel 4. Add our components to the GUI 5. Set up event handlers GUIs and Java WHAT’s THIS?

GUIs and Java (cont’d) Step 1. Make a Frame Import these: import javax.swing.Jframe; import java.awt.event.*; import java.awt.*; To make a frame, our class has to extend Jframe: public class RectangleProgram extends JFrame

GUIs and Java (cont’d) Step 1 – Frame - Here’s the basic Java code: Code Credits (entire lesson):

GUIs and Java (cont’d) Step 2. Create a Content Pane a. Use a Container object to manipulate the content pane b. Use a cool statement: getContentPane() c. class Container has two methods add (we use this later) setLayout d. setLayout calls the Layout Manager to create a simple grid layout with 4 rows and 2 columns.

GUIs and Java (cont’d) Step 2. Create a Content Pane Here’s the Java code:

GUIs and Java (cont’d) Step 3. Make Components: Label TextField Button

GUIs and Java (cont’d) Step 4. Put Components In Pane Here’s the Java code:

GUIs and Java (cont’d) Step 5. Create Event Handlers

GUIs and Java (cont’d) Basic GUI Program

GUIs and Java (cont’d) Basic GUI Program (cont’d)

GUIs and Java (cont’d) Basic GUI Program (cont’d)

GUIs and Java (cont’d) Basic GUI Program (cont’d)

GUIs and Java (cont’d) Basic GUI Program (cont’d)

How We will Use GUIs Assignment 5: Add GUI to Intelligent TicTacToe Game (use your Assignment-4 program) Playing Canvas = Expandable N x N array Components Include - Buttons for Start NextPlayer Continue End - Text Fields for CurrentPlayer Move Winner … and more …

This Week: Sets, Collections, Lists… Wednesday 3 Apr 2013: More GUIs in JAVA Coding Examples Friday 5 Apr 2013: How to do Assignment #5, Part II (LAPTOPS) EXAM #2 – Wednesday 10 April – IN CLASS