GUIs for Applets Introduction Applets and Swing/JFC Alternatives to Swing Look-and-Feel issues Example applet graphical user interfaces.

Slides:



Advertisements
Similar presentations
G5BUID - Java Swing What is Swing? A part of The Java Foundation Classes Swing Look and feel Accessibility Java 2D (Java 2 onwards) Drag and Drop.
Advertisements

Introduction to Java 2 Programming
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)
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.
Introduction to GUI Programming
Creating a GUI with Swing. Introduction Very useful link: Swing – is a part of JFC (Java Foundation.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh 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.
CC1007NI: Further Programming Week 5 Dhruba Sen Module Leader (Islington College)
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
GUI Programming in Java
Swing part-one Eriq Muhammad Adams J
Software Construction Lecture 10 Frameworks
Java Swing, Events and MVC Optional Readings: Eckel’s Thinking in Java: Chap 14 (
Applets and Frames CS 21a: Introduction to Computing I First Semester,
Object Oriented Programming Ders 11: Interfaces Mustafa Emre İlal
Cs413_chapt01.ppt Chapter 1 Web Sites Numerous
Objectives of This Session
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.
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.
School of Computer Science & Information Technology G6DICP - Lecture 17 GUI (Graphical User Interface) Programming.
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.
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
MSc Workshop - © S. Kamin, U. ReddyLect 3 - GUI -1 Lecture 3 - Graphical User Interfaces r GUI toolkits in Java API r JFrame r GUI components.
Object Oriented programming Instructor: Dr. Essam H. Houssein.
SWING 101. IF YOU GET LOST - IMPORTANT LINKS  Swing articles:
Java GUI building approaches Aleksandar Kartelj Faculty of Mathematics, Belgrade 11 th Workshop “Software Engineering Education and.
CS Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /20/2015 GUI - Graphical User Interface.
Swing / Session1 / 1 of 30 Module Introduction Distributed Computing in Java.
Week 6: Basic GUI Programming Concepts in Java Example: JFrameDemo.java container : a screen window/applet window/panel that groups and arranges components.
CS 4244: Internet Programming User Interface Programming in Java 1.0.
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.
The Swing GUI Components Chapter 29 An enhanced alternative to AWT The PC does not need an appletviewer or browser Swing overcomes some AWT drawbacks.
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.
1 Chapter 16: Creating Windows. 2 Basics of GUI Programming How to create a Window. TryWindow.java You always need a JFrame component before creating.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
SE-1020 Dr. Mark L. Hornick 1 Graphical User Interfaces.
Client-Server applications Introduction to Java Applets Client-server architectures Why do Applets exist? What can an Applet do?
Java Swing, Events Readings: Just Java 2: Chap 19 & 21, or Eckel’s Thinking in Java: Chap 14 Slide credits to CMPUT 301, Department of Computing Science.
Developing GUIs With the Eclipse Visual Editor, SWT Edition David Gallardo.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Developing GUIs With the Eclipse Visual Editor, Swing/AWT Edition David Gallardo.
Introduction to GUI Programming in Java: Frames, Simple Components, and Layouts.
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.
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.
A Quick Java Swing Tutorial
Graphical User Interfaces
Welcome To java
Provision for GUIs in Java
Review: Java GUI Programming
Lecture 27 Creating Custom GUIs
Introduction to Graphical Interface Programming in Java
Building Graphical User Interface with Swing a short introduction
Advanced Programming in Java
Chapter 12 GUI Basics.
Graphical User Interface
Presentation transcript:

GUIs for Applets Introduction Applets and Swing/JFC Alternatives to Swing Look-and-Feel issues Example applet graphical user interfaces How do I build a GUI? Conclusion

GUIs for Applets Applets and Swing/JFC Swing is a kit of GUI “widgets” - it provides a simple way to create, position and interact with standard interface components It is a major part of the Java Foundation Classes (c.f. MFC, Microsoft Foundation Classes)‏ It is a “lightweight” component library, uses the MVC (model-view-controller) architecture design pattern Applets may use most Swing components For security reasons some are restricted (which ones?)‏

GUIs for Applets Alternatives to Swing The original GUI system for Java was called the “Abstract Windowing Toolkit” or AWT NB Swing is based on many of the AWT components, either through compatible methods or through inheritance AWT is a “heavyweight” component library, uses the widgets built into the underlying OS architecture It has some OS-specific behaviour and thus some portability problems

GUIs for Applets Alternatives to Swing SWT is the Standard Widget Toolkit originally developed by IBM as part of the Eclipse project (see It is seen a “thin wrapper” over the native GUI of the host OS – it is a “heavyweight” library It is not OS-specific but was originally designed to run in MS Windows SWT attempts to use the strengths of the Swing and AWT approaches while staying simple and quick

GUIs for Applets Examples Simple visual applet with mouse- sensitive image- based components Note that the title bar is not settable This is a Swing- based Japplet running in Win XP

GUIs for Applets Swing Example Quite a lot of components in this simple applet JLabel, JCheckBox, JTextArea, JComboBox, JButton, JRadioButton This applet will look very similar in any graphical OS

GUIs for Applets Swing Example This example shows most of the simple Swing components The GUI is X- Windows wiki/Image:Gui-widgets.png

GUIs for Applets SWT platform-specific examples The Standard Widget Toolkit (SWT) library uses heavyweight components Tied to the look-and-feel of the host OS

GUIs for Applets SWT – a familiar example Eclipse has one of the best-known examples of SWT in action Looks good and works well

GUIs for Applets Building a GUI Choose AWT, Swing (recommended) or SWT Learn about component types, event handlers and layout options – documentation and examples Design a user interface and critically evaluate it Revise and repeat! For background on development in AWT, with reference to Swing, see “Graphical User Interface (GUI) Fundamentals” (old article) [

GUIs for Applets Conclusion There are varied ways to build GUI applications in Java Applets Different approaches have different strengths and weaknesses Swing is often a good choice (widely supported, flexible, elegant but quite complex)‏ Predefined widgets/components are available for most tasks Designing a good interface is hard

GUIs for Applets Optional Further Reading Swing article on Wikipedia [ Applet article on Wikipedia [ Standard Widget Toolkit article on Wikipedia [ Swing documentation (Sun) [ How to make Applets (Sun) [