AWT Components (Chapter 9) Java Certification Study Group January 21, 1999 Mark Roth.

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

Java GUI building with the AWT. AWT (Abstract Window Toolkit) Present in all Java implementations Described in (almost) every Java textbook Adequate for.
Objectives The objectives of this chapter are: To discuss the classes present in the java.awt package To understand the inheritance hierarchy of the AWT.
AWT Components. 2 Using AWT Components 4 Component –Canvas –Scrollbar –Button –Checkbox –Label –List –Choice –TextComponent –TextArea –TextField 4 Component.
F27SB2 Programming Languages
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.
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.
Jan AWT Widgets Yangjun Chen Dept. Business Computing University of Winnipeg.
Jan Event Handling -1.1 Yangjun Chen Dept. Business Computing University of Winnipeg.
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.
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette Sept 9, 2004 Last update:
June 1, 2000 Object Oriented Programming in Java (95-707) Advanced Topics 1 Lecture 9 Object Oriented Programming in Java Advanced Topics Abstract Windowing.
CS3157 Java UI Recitation. Material Covered: Overview of AWT components, Event Handling, creating applets, and sample UI. Not covered in recitation: Drawing,
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.
12-Jul-15 Components. 2 Types of Components Button Canvas Checkbox Choice Label List Scrollbar TextComponent TextArea TextField.
10.1 AWT The AWT classes Users today expect a Graphical User Interface (GUI) Improves application usability Difficult to implement cross-platform.
Applets, AWTS CompSci 230 Software Construction.
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.
Universidad Nacional de Colombia Facultad de Ingeniería Departamento de Sistemas ertificación en AVA.
Java GUI building with the AWT. AWT (Abstract Window Toolkit) Present in all Java implementations Described in (almost) every Java textbook Adequate for.
Java Programming 1 Java Programming II Events, AWT, and Swing.
C13a, AWT Create, display, facilitate user interaction with window objects software framework: a way of structuring generic solutions to common problems.
Abstract Window Toolkit (AWT) The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include:  A rich set.
Objectives of This Session
1 Unit 5 GUI Aum Amriteshwaryai Namah. 2 Overview Shall learn how to reuse the graphics classes provided by Java for constructing Graphical User Interface.
CS102 – GUI AWT & Swing Components & Containers, Layout Managers, Events & Listeners MVC design pattern. David Davenport.
1 / 67 COP 3503 FALL 2012 SHAYAN JAVED LECTURE 14 Programming Fundamentals using Java 1.
9.1 Java Packages A collection of classes Allows classes to be grouped arbitrarily Hierarchical structure independent of inheritance Classes can.
Object Oriented Programming.  Interface  Event Handling.
May 12, 1998CS102-01Lecture 7-3 Building GUIs in Java I CS Lecture 7-3 A picture's worth a thousand words.
Graphical User Interfaces. Graphical input and output with JOptionPane.
Painting (Chapter 12) Java Certification Study Group January 25, 1999 Mark Roth.
AWT Package. Java GUI classes are contained in the java.awt package. Java GUI classes are contained in the java.awt package. A graphical Java program.
CIS Intro to JAVA Lecture Notes Set 8 9-June-05.
CSI 3125, Preliminaries, page 1 AWT Control. CSI 3125, Preliminaries, page 2 AWT Control The AWT supports the following types of controls: ■ Labels ■
CSI 3125, Preliminaries, page 1 AWT. CSI 3125, Preliminaries, page 2 AWT Java AWT (Abstract Windowing Toolkit) is an API to develop GUI or window-based.
AWT Layout Managers (Chapter 10) Java Certification Study Group January 21, 1999 Mark Roth.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
Lecture # 6 Graphical User Interface(GUI). Introduction A graphical user interface (GUI) presents a user- friendly mechanism for interacting with an application.
Events (Chapter 11) Java Certification Study Group January 25, 1999 Mark Roth.
Chapter 12: The Abstract Window Toolkit Java Programming FROM THE BEGINNING Copyright © 2000 W. W. Norton & Company. All rights reserved. 1 Chapter 12.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
1 Java and AWT CPS 470 Spring 1998 Laura Campbell.
1 Lecture 8: User Interface Components with Swing.
AWT Java AWT (Abstract Windowing Toolkit) is an API to develop GUI or window-based application in java. Java AWT components are platform-dependent i.e.
Java Programming (By Rama Bhadra Rao M) You can Trace me in Day 5
AWT Vs SWING. 2 AWT (Abstract Window Toolkit) Present in all Java implementations Described in most Java textbooks Adequate for many applications Uses.
CSC 205 Programming II Lecture 5 AWT - I.
GUI building with the AWT
Welcome To java
Aum Amriteshwaryai Namah
Java Events. Java Events Important definitions Overridden method Class vs. abstract class vs. interface Event Handling Definition Main components Windows.
Responding to Events Event Handling in Java
Advanced GUIs II CS Lecture
Course Outcomes of Advanced Java Programming AJP (17625, C603)
Abstract Window ToolKit (AWT)
Chap 7. Building Java Graphical User Interfaces
Chapter 13: Advanced GUIs and Graphics
Graphical User Interfaces -- Introduction
AWT.
AWT Components and Containers
GUI building with the AWT
GUI building with the AWT
AWT Components Java AWT components are platform-dependent i.e. components are displayed according to the view of operating system. AWT is heavyweight i.e.
Objectives The objectives of this chapter are:
Advanced GUIs and Graphics
Presentation transcript:

AWT Components (Chapter 9) Java Certification Study Group January 21, 1999 Mark Roth

Components java.awt.Component –“A component is an object having a graphical representation that can be displayed on the screen and that can interact with the user.” - Javadoc java.awt.MenuComponent –“The abstract class MenuComponent is the superclass of all menu-related components.” - Javadoc

java.awt.Compoennt Dimension getSize() void setForeground( java.awt.Color ) void setBackground( java.awt.Color ) setFont( java.awt.Font ) setEnabled( boolean ) setSize( width, height ) These Only Work Well for Frames: –setBounds( Rectangle ) or (x, y, w, h) –setVisible( boolean )

Component Categories (11) Visual Components (4) Container Components (4) Menu Components

Visual Components “…the ones that users can actually see and interact with.” - S. Roberts To Use: –Create a new instance –Add component to a container

Constructing Visual Components Button( String label ) --> ActionEvent Canvas() --> MouseEvent, MouseMotionEvent, KeyEvent Checkbox( String label, boolean initialState ) --> ItemEvent Choice() --> ItemEvent FileDialog( Frame parent, String title, int mode ) Label( String text, int alignment )

Constructing Visual Components List( int nVisibleRows, boolean multiSelectOk ) --> ItemEvent, ActionEvent ScrollPane( int scrollbarPolicy ) --> MouseEvent, MouseMotionEvent Scrollbar( int orientation, int initialValue, int sliderSize, int minValue, int maxValue ) --> AdjustmentEvent

Constructing Visual TextComponents TextField( String text, int nCols ) TextArea( String text, int nRows, int nCols, int scrollbarPolicy ) Events –TextEvent (both, when text is typed) –ActionEvent (Enter in TextField)

Constructing Container Components Applet() Frame( String title ) Panel() Dialog()

Menu Components Creation –Create a menu bar and attach it to the frame. –Create and populate the menu. –Attach the menu to the menu bar. Populating the Menu –Menu items –Check-box menu items –Separators –Menus

MenuItem( text ) --> ActionEvent CheckBoxMenuItem() --> ItemEvent menu.addSeparator() setHelpMenu() Menu

References All Material in this Presentation is heavily based on: Roberts, Simon and Heller, Philip, Java 1.1 Certification Study Guide, 1997: SYBEX™. ISBN: Selected portions from JDK JavaDoc HTML pages.