May 6, 1998CS102-02Lecture 6-2 Cross-Platform Programming CS 102-02 Lecture 6-2 Making everyone happy.

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.
Java Software Development Paradigm Lecture # 12. Basics of GUI.
LAYOUT OF PAGE ELEMENTS September 28 th, PATTERNS Common ways to use the Layout Elements of Visual Hierarchy, Visual Flow, Grouping and Alignment,
Corresponds with Chapter 12
Understanding SWING Architecture CS 4170 UI Design Hrvoje Benko Oct. 9, 2001.
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.
Advanced Java Class GUI – part 1. Intro to GUI GUI = Graphical User Interface -- “Gooey” Just because it’s “gooey” does not mean you may write messy code.
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.
CS 112 GUI 06 May 2008 Bilkent. Java GUI API Containers: ◦ contain other GUI components. E.g, Window, Panel, Applet, Frame Dialog. Components: ◦ Buttons,
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
Java Programming Chapter 10 Graphical User Interfaces.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Chapter 13 Advanced GUIs and Graphics. Chapter Objectives Learn about applets Explore the class Graphics Learn about the class Font Explore the class.
Web Technologies Website Development Trade & Industrial Education
Web Site Design Principles
Website Development with Dreamweaver
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,
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.
Java Programming: Advanced Topics 1 Common Elements of Graphical User Interfaces Chapter 6.
Cs413_chapt01.ppt Chapter 1 Web Sites Numerous
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.
Objectives of This Session
Dale Roberts GUI Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Session 27 Swing vs. AWT. AWT (Abstract Window ToolKit) It is a portable GUI library for stand-alone applications and/or applets. The Abstract Window.
– Advanced Programming P ROGRAMMING IN Lecture 21 Introduction to Swing.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
CS Lecture 00 Swing overview and introduction Lynda Thomas
Lecture 10: Toolkits: Intrinsics, Callbacks, Resources, Widget hierarchies, Geometry management Brad Myers Advanced User Interface Software 1© 2013.
Object Oriented programming Instructor: Dr. Essam H. Houssein.
Cs413_chapt02.ppt CS413 Advanced Swing Graphical User Interface Components Text: Advanced Java 2 Platform: Chapter 2 Abstract Windowing Toolkit (AWT) Library.
Java Applets: GUI Components, Events, Etc. Ralph Westfall June, 2010.
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.
Computer Science [3] Java Programming II - Laboratory Course Lab 4: Common GUI Event Types and Listener Interfaces Layout Mangers Faculty of Engineering.
Lec.10 (Chapter 8 & 9) GUI Jiang (Jen) ZHENG June 27 th, 2005.
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
CS 4244: Internet Programming User Interface Programming in Java 1.0.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
GUIs Graphical User Interfaces. Everything coming together Known: – Inheritance – Interfaces – Abstract classes – Polymorphism – Exceptions New: – Events.
Graphical User Interfaces Tonga Institute of Higher Education.
AWT Layout Managers (Chapter 10) Java Certification Study Group January 21, 1999 Mark Roth.
INFORMATION SYSTEM – SOFTWARE TOPIC: GRAPHICAL USER INTERFACE.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Applets. 9/04/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L12: Applets Slide 2 Applets Usually.
Introduction to GUI Programming in Java: Frames, Simple Components, and Layouts.
Getting Started with GUI Programming Chapter 10 CSCI 1302.
Chapter 9: Graphical User Interfaces
CompSci 230 S Software Construction
Event loops 16-Jun-18.
Java Look-and-Feel Design Guidelines
Lecture 27 Creating Custom GUIs
Ellen Walker Hiram College
Chap 7. Building Java Graphical User Interfaces
Chapter 13: Advanced GUIs and Graphics
Graphical User Interfaces -- Introduction
Event loops.
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Week 8 Swing NetBeans GUI Builder
Event loops 8-Apr-19.
Event loops.
Event loops 19-Aug-19.
Graphical User Interface
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

May 6, 1998CS102-02Lecture 6-2 Cross-Platform Programming CS Lecture 6-2 Making everyone happy

May 6, 1998CS102-02Lecture 6-2 Agenda Two kinds of inheritance Interfaces in Java The End of OO

May 6, 1998CS102-02Lecture 6-2 Web vs. Java Design Web designers are used to testing their sites and pages on –Multiple platforms –Screen resolutions –Color ranges –Browsers Can't just create Web sites on and for their own high-powered, million-color development machines

May 6, 1998CS102-02Lecture 6-2 Graphics across Platforms Different computers almost agree on text, but strongly disagree on graphics –Screen resolutions –Colors: 8-bit grey, 16-bit and 24-bit –Fonts: Not everybody has Times New Roman Narrow –User interface: Keyboards, mouse button count and accessibility

May 6, 1998CS102-02Lecture 6-2 Cross-Platform Fonts Different platforms have different fonts –Different names for similar fonts Java has a set of logical fonts –Monospaced, Dialog, Serif and Sans Serif –Font attributes (size, style,...)

May 6, 1998CS102-02Lecture 6-2 The Abstract Windowing Toolkit Abstract away the details of building graphical user interfaces (GUIs)

May 6, 1998CS102-02Lecture 6-2 The AWT Hierarchy

May 6, 1998CS102-02Lecture 6-2 The Need for Abstraction

May 6, 1998CS102-02Lecture 6-2 Arranging Things Java uses layout managers to control how components appear on-screen –Achieve different effects by using different layout managers –Going without Grid layout Flow layout

May 6, 1998CS102-02Lecture 6-2 Laying It All Out

May 6, 1998CS102-02Lecture 6-2 Picking a Layout Manager I Need to display a component in as much space as it can get. –Consider using BorderLayoutBorderLayout put the space-hungry component in the center –GridBagLayoutGridBagLayout Set the constraints for the component so that fill=GridBagConstraints.BOTH From The Java Tutorial

May 6, 1998CS102-02Lecture 6-2 Picking a Layout Manager II Need to display a few components in a compact row at their natural size. –Use a Panel to hold the components –Use Panel's default FlowLayout managerFlowLayout Need to display a few same-sized components in rows and/or columns. –GridLayout fits the billGridLayout From The Java Tutorial

May 6, 1998CS102-02Lecture 6-2 The AWT Works for You Abstraction is all well and good, but Java programs still need to run on actual machines Just one API for buttons (provided by the Button class) –Looks different on a Macintosh than on a PC running Windows 95. Peer classes link the AWT components you see to the underlying platform

May 6, 1998CS102-02Lecture 6-2 Behind the Scenes

May 6, 1998CS102-02Lecture 6-2 Swingin' with Java Swing components are lightweight Use a different architecture than AWT

May 6, 1998CS102-02Lecture 6-2 Swing Look-and-Feel Metal (Java) Early Mac MotifWindows Organic (Santa Fe) Organic (Vancouver)

May 6, 1998CS102-02Lecture 6-2 Beans JavaBeans is a portable, platform- independent software component model written in Java Enables developers to write reusable components once and run them anywhere

May 6, 1998CS102-02Lecture 6-2 Going Cross-Platform with Java Graphics –GUI components –Fonts –Swing Sharing software –Beans