Graphical User Interfaces Tonga Institute of Higher Education.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming
Advertisements

Java GUI building with the AWT. AWT (Abstract Window Toolkit) Present in all Java implementations Described in (almost) every Java textbook Adequate for.
Graphical User Interfaces
Graphical User Interfaces (Part IV)
Java Software Development Paradigm Lecture # 12. Basics of GUI.
CS18000: Problem Solving and Object-Oriented Programming.
Unit 3 Graphical User Interface (GUI) Dr. Magdi AMER.
Graphic User Interfaces Layout Managers Event Handling.
CMSC 341 Building Java GUIs. 09/26/2007 CMSC 341 GUI 2 Why Java GUI Development? Course is about Data Structures, not GUIs. We are giving you the opportunity.
Corresponds with Chapter 12
Event Driven Programming and GUIs Part 3 CS221 – 4/15/09.
More Advanced AWT Last week, you learned about Applets, Lists, and Buttons AWT provides several other “widgets” and tools: –Labels –Choice boxes –Check.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
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.
Swing CS-328 Dick Steflik John Margulies. Swing vs AWT AWT is Java’s original set of classes for building GUIs Uses peer components of the OS; heavyweight.
1 GUI Elements in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
GUI Layout Managers Arkadiusz Edward Komenda. Outline Components and Containers Layout Managers Flow Layout Grid Layout Border Layout Nested Containers.
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Java GUI building with the AWT. 2 AWT (Abstract Window Toolkit) Present in all Java implementations Described in most Java textbooks Adequate for many.
GUI and event-driven programming An introduction.
GUI Basics: Introduction. Creating GUI Objects // Create a button with text OK JButton jbtOK = new JButton("OK"); // Create a label with text "Enter your.
Java Programming Chapter 10 Graphical User Interfaces.
Chapter 13 Advanced GUIs and Graphics. Chapter Objectives Learn about applets Explore the class Graphics Learn about the class Font Explore the class.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Java Programming: From Problem Analysis to Program Design, 4e Chapter 12 Advanced GUIs and Graphics.
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.
Java Programming: Advanced Topics 1 Common Elements of Graphical User Interfaces Chapter 6.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Graphical User Interfaces Tonga Institute of Higher Education.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
Timer class and inner classes. Processing timer events Timer is part of javax.swing helps manage activity over time Use it to set up a timer to generate.
Object Oriented programming Instructor: Dr. Essam H. Houssein.
Layout Manager Summary
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.
GUI Basics. What is GUI? A graphical user interface (GUI) is a type of user interface item that allows people to interact with programs in more ways than.
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.
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
Introduction to Java Chapter 9 - Graphical User Interfaces and Applets1 Chapter 9 Graphical User Interfaces and Applets.
Basics of GUI Programming Chapter 11 and Chapter 22.
AWT Layout Managers (Chapter 10) Java Certification Study Group January 21, 1999 Mark Roth.
Graphical User Interfaces (GUI). PART ONE About GUI’s.
Graphical User Interface (GUI) Two-Dimensional Graphical Shapes.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Graphical User Interface (GUI)
Event Handler Methods Text field Object Responder JAVA AWT Environment: Messages are sent between JAVA Objects Screen Event Notification Press Button.
Introduction to GUI in 1 Graphical User Interface 3 Nouf Almunyif.
Introduction to GUI Programming in Java: Frames, Simple Components, and Layouts.
Getting Started with GUI Programming Chapter 10 CSCI 1302.
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.
AWT Vs SWING. 2 AWT (Abstract Window Toolkit) Present in all Java implementations Described in most Java textbooks Adequate for many applications Uses.
Graphical User Interfaces
Chapter 9: Graphical User Interfaces
Christopher Budo, Davis Nygren, spencer franks, Luke miller
Modern Programming Language Java
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
Chapter 14 JavaFX Basics Dr. Clincy - Lecture.
Creating Graphical User Interfaces
Graphical User Interface
GUI Test Information.
Zhen Jiang West Chester University
GUI building with the AWT
Graphical User Interface
TA: Nouf Al-Harbi NoufNaief.net :::
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

Graphical User Interfaces Tonga Institute of Higher Education

Graphical User Interfaces Graphical User Interface – A program that displays program information using windows

GUI Objects Control  Classes used to implement user interface components Message Box / Dialog Box  An attention getter  Displays information to the user  Forces user to do something click before continuing  Use JOptionPane class Frames / Windows  Frame – Is a container for other GUI elements.  Use JFrame class  Allows user to see a window  Contains other controls

UI Objects / Controls - 1 Control  Discussed earlier Frame  Discussed earlier Label  Adds text to the window Text Box  Allows user to enter text Text Box Label Frame

UI Objects / Controls - 2 Combo Box  Allows user to select one option from a list of options  The user may see the options when they click on the control Radio Button  Allows user to select an option from a group of options  Only one option may be selected at a time  Lets users see options Check Box  Allows user to turn one option on or off (True or False) Combo Box Radio Button Check Box

UI Objects / Controls - 3 Button  Initiates code when clicked Button

Packages for GUIs Abstract Windowing Toolkit (AWT)  Older package  Still useful Swing  Very popular

A Simple Form Tells the class that It is a frame Constructor Package Needed Settings for the frame go in the constructor

Demonstration Simple Form GUIDemo1

Layouts FlowLayout  Arranges controls in a left-to-right flow.  Similar to a paragraph  Each line is centered GridLayout  Arranges controls in a rectangular grid  Each control is divided into equal-sized rectangles BorderLayout  Arranges controls to fit in 5 regions NORTH SOUTH WEST EAST CENTER  Only 1 object may be in each region

Coding Layouts Constructor Additional Code Follows You must include these steps when you set up a layout Can be FlowLayout, GridLayout, Or BorderLayout

Demonstration Layouts GUIDemo2

Absolute Positioning Constructor Used to put controls exactly in a place that you give coordinates for. Used to set the exact size of a control. Set location with x and y coordinates Set size with width and height values You must include these steps!

Demonstration Absolute Positioning GUIDemo3

Other Controls Most controls work the same way!

Demonstration Other Controls GUIDemo4

Radio Buttons Radio Groups contain Radio Buttons

Demonstration Radio Buttons GUIDemo5

Code Conventions Different companies use different prefixes to identify controls  Button – btn, cmd  Check Box – chk  Combo Box – cbo  Frame – frm  Label – lbl  Radio Button – rad, rdo, opt  Text Box – txt Use the ones you like. Be consistent!