Java GUI building approaches Aleksandar Kartelj Faculty of Mathematics, Belgrade 11 th Workshop “Software Engineering Education and.

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

1 Graphical User Interface (GUI) Applications Abstract Windowing Toolkit (AWT) Events Handling Applets.
Introduction to Java 2 Programming
IIIMF GUI Open Source Software Foundry
Introduction to Eclipse plugin development for CSU 670 course project, Selector language (Xaspect) editor plugin implementation.
Presented by Benjamin Kehrer [CSCI 360, CofC, 03/17/08]
Unit 091 Introduction to GUI Programming Introduction to User Interfaces Introduction to GUI Programming GUI Design Issues GUI Programming Issues Java.
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.
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Introduction to GUI Programming
Overview of Swing’s MVC Architecture By Geoffrey Steffens (BCSi), Socket Software, Australia Copyright © Socket Software, 2002.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
1 Standard Widget Toolkit. 2 SWT l a widget toolkit for Java developers l provides a portable API and tight integration with the underlying native OS.
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
Written by Liron Blecher
Swing part-one Eriq Muhammad Adams J
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
CSC300 Visual Programming Dr. Craig Reinhart. Objectives Teach the basics of C++ –You won’t be an expert but hopefully a very good novice –GUI development.
Software Construction Lecture 10 Frameworks
Introduction to Eclipse and Eclipse RCP Kenneth Evans, Jr. Presented at the EPICS Collaboration Meeting June 13, 2006 Argonne National Laboratory, Argonne,
© 2012 Google, Inc. 1 Building GUIs with WindowBuilder EclipseCon 2012 March 28, 2012 Eric Clayberg Software Engineering Manager Google, Inc.
Java Swing, Events and MVC Optional Readings: Eckel’s Thinking in Java: Chap 14 (
JavaBeans Components. To understand JavaBeans…  Proficient experience with the Java language required  Knowledge of classes and interfaces  Object-Oriented.
GUIs for Applets Introduction Applets and Swing/JFC Alternatives to Swing Look-and-Feel issues Example applet graphical user interfaces.
Ex3 Preview, Swing tutorial Ex1 review Amit Shabtay.
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.
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
Introducing the Eclipse Visual Editor David Gallardo.
Cs413_chapt01.ppt Chapter 1 Web Sites Numerous
Swing and MVCS CompSci 230 Software Construction.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
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.
Automated GUI testing How to test an interactive application automatically?
CS Lecture 00 Swing overview and introduction Lynda Thomas
CPSC 372 John D. McGregor Module 3 Session 1 Architecture.
SWING 101. IF YOU GET LOST - IMPORTANT LINKS  Swing articles:
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.
Frameworks CompSci 230 S Software Construction.
Applets Yong Choi School of Business CSU, Bakersfield.
CS Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /20/2015 GUI - Graphical User Interface.
CPSC 871 John D. McGregor Module 3 Session 1 Architecture.
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.
QPE A Graphical Editor for Modeling using Queueing Petri Nets Christofer Dutz.
Boris Milašinović Faculty of Electrical Engineering and Computing University of Zagreb, Croatia 15th Workshop on "Software Engineering Education and Reverse.
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.
ArgoUML Peterson Lorins Chi-Hwa John Marcos Dawid Trawczynski Leticia Izquierdo EEL5881 Software Engineering I Spring 2002 – Dr. Schiavone.
Past Computing Environments: Swing Ian Smith UI Toolkits (History Lesson) 4 Programming tools for building interfaces 4 Originally in Java you had AWT.
Developing GUIs With the Eclipse Visual Editor, Swing/AWT Edition David Gallardo.
 Can access all API’s made available by OS vendor.  SDK’s are platform-specific.  Each mobile OS comes with its own unique tools and GUI toolkit.
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.
Common Client Rich Client Platforms
A Quick Java Swing Tutorial
Welcome To java
CST 1101 Problem Solving Using Computers
Provision for GUIs in Java
Java Look-and-Feel Design Guidelines
Review: Java GUI Programming
Provision for GUIs in Java
Lecture 8 Object Oriented Programming Using Java
Swing & the JFC – Advanced Java GUI
Building Graphical User Interface with Swing a short introduction
Starting Design: Logical Architecture and UML Package Diagrams
Week 8 Swing NetBeans GUI Builder
Presentation transcript:

Java GUI building approaches Aleksandar Kartelj Faculty of Mathematics, Belgrade 11 th Workshop “Software Engineering Education and Reverse Engineering” Ohrid, 22 nd August – 27 th August 2011

Presentation overview Java GUI API Java GUI builders Manual vs WYSIWYG vs Metadata based approaches Conclusions

Brief history of Java GUI APIs AWT, host dependent Internet Foundation Classes (IFC) by Netscape Sun, Netscape and IBM combined technologies like AWT and IFC to form Java Foundation Classes JFC later consisted of AWT, Java 2D, Swing…

AWT (Abstract Window Toolkit) Low level of abstraction over underlying user interface Control presentation depends on the op. system Two APIs:  Interfaces between Java and native system for windowing, events, layouts…  GUI widgets: buttons, text boxes…

Swing Written in Java, (doesn’t call native routines of the host, rather its own Java 2D and other) Consequence: unified but also pluggable look and feel Model-View-Controller architecture

MVC architecture in Swing

SWT (Standard Widget Toolkit) Graphical widget toolkit to use with Java platform Developed originally by IBM, maintained by the Eclipse Foundation Written in Java, but implementation of toolkit is unique for each platform Programs that call SWT are portable

SWT design and performance Referred as “light” Java wrapper around a “heavy” native object Compromise between low level performance of AWT and high level ease of use of Swing Too simple and to hard to port to new platforms Not using enough design patterns, especially MVC as Swing does

GUI Builders

Most usual approaches:  WYSIWYG  Metadata (usually XML) BAD: Mix logic and interface. This is a typical style for small student programs. The code to perform the action of a button is in the button's action listener. This does NOT scale well as programs get bigger. GOOD: Separate GUI from logic. As programs grow larger, it's essential to separate the GUI interface processing from the logic. This is easy to do by putting the interface and logic in separate classes. Some GUI generators below help accomplish this.

GUI Builders – other problems Parts of the code are not readable Parts of the code are not editable It will be harder to edit the code later No one can assure that the tool will be available and supported in the future

Generated code

Manually coded

Difference in code In this example:  ≈150 lines of code generated vs ≈100 manually coded  Netbeans used GroupLayout, whereas manual used BorderLayout and FlowLayout  Manual code is more readable

XML builders - SwiXml

Merits and drawbacks +- GUI by handClean, sustainable development. Smaller code. High need for design patterns. Slow start up, can require longer planning. WYSIWYGQuick start. Separates GUI from logic. Intuitive for beginners, they can learn from generated code. Two-ways editors are ok. Low level of code reusability. Doesn’t separate logic from interface Metadata based Doesn’t require code recompilation. Very clean MVC approach. Easiest to unify over diff. languages. XML can get complex and confusing.

Conclusion Hand coding recommended for professionals, working on complex apps WYSIWYG is not bad choice for smaller apps and total beginners Metadata based – probably the future of GUI building For thinking: WYSIWYG + Metadata?

Thank you for your time.