Java Swing Introduction

Similar documents
Introduction to the JAVA UI classes Advanced HCI IAT351

Using NetBeans IDE for Desktop Development. Geertjan Wielenga

Heavyweight with platform-specific widgets. AWT applications were limited to commonfunctionality that existed on all platforms.

Graphical User Interface (GUI)

Graphical User Interfaces (GUIs)

Jakob Nielsen s Heuristics (

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class

KF5008 Program Design & Development. Lecture 1 Usability GUI Design and Implementation

Heuristic Evaluation

VizzAnalyzer goes Eclipse!

Introduction to Internet Applications

Design Heuristics and Evaluation

Introduction to Graphical Interface Programming in Java. Introduction to AWT and Swing

1. What is Jav a? simple

Graphic User Interfaces. - GUI concepts - Swing - AWT

Educational Fusion. Implementing a Production Quality User Interface With JFC

Heuristic Evaluation. Ananda Gunawardena. Carnegie Mellon University Computer Science Department Fall 2008

Heuristic Evaluation of [ Quest ]

Building a Java First-Person Shooter

Assignment 5 is posted! Heuristic evaluation and AB testing. Heuristic Evaluation. Thursday: AB Testing

GUI and its COmponent Textfield, Button & Label. By Iqtidar Ali

encompass a group of features for building Graphical User Interfaces (GUI).

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1

Review. Designing Interactive Systems II. Introduction. Web 2.0 in keywords GWT Cappuccino HTML5. Cross platform GUI Toolkit

Designing Interactive Systems II

Computer Systems & Application

Usability. Daniela Rosner. Web Architecture, October 9, School of Information UC Berkeley

An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a

Event Driven Programming

Hyper Mesh Code analyzer

Swing. By Iqtidar Ali

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

G51PGP Programming Paradigms. Lecture 009 Concurrency, exceptions

Graphical User Interface (GUI)

Lecture 1 - Introduction (Class Notes)

1. Select/view stores based on product type/category- 2. Select/view stores based on store name-

Heuristic Evaluation of igetyou

Swing: Building GUIs in Java

Java WebStart, Applets & RMI

(Incomplete) History of GUIs

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

HCI and Design SPRING 2016

Swing: Building GUIs in Java

Page 1. Human-computer interaction. Lecture 1b: Design & Implementation. Building user interfaces. Mental & implementation models

Page 1. Ideas to windows. Lecture 7: Prototyping & Evaluation. Levels of prototyping. Progressive refinement

Crab Shack Kitchen Web Application

Interaction Design. Heuristic Evaluation & Cognitive Walkthrough

Quality Assurance User Interface Modeling

Heuristic Evaluation. Jon Kolko Professor, Austin Center for Design

UX DESIGN BY JULIA MITELMAN

CS506 Web Programming and Development Solved Subjective Questions With Reference For Final Term Lecture No 1

EPITA Première Année Cycle Ingénieur. Atelier Java - J5

Beyond CSE143. What s Left To Do? Templates. Using Templates. A Template Class. A Problem with Reusing Code CSE 143

Applying Usability to elearning

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java

CS112 Lecture: Defining Instantiable Classes

GUI Applications. Let s start with a simple Swing application in Java, and then we will look at the same application in Jython. See Listing 16-1.

Object-Oriented Programming Design. Topic : Graphics Programming GUI Part I

Page 1. Human-computer interaction. Lecture 2: Design & Implementation. Building user interfaces. Users and limitations

G52PGP. Lecture oo3 Java (A real object oriented language)

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software.

State Application Using MVC

Graphical User Interface (GUI)

How to make a "hello world" program in Java with Eclipse *

Java Thread Programming By Paul Hyde

SEPA diary Heuristic evaluation

CS Exam 1 Review Suggestions

GUI Implementation Support

For live Java EE training, please see training courses at

CO328- Human Computer Interaction Michael Kölling Caroline Li. Heuristic Evaluation

Building a Java First-Person Shooter

Programming Languages and Techniques (CIS120)

Usability & User Centered Design. SWE 432, Fall 2018 Design and Implementation of Software for the Web

User-Centered Design. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Class 16: The Swing Event Model

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

JAVA Unit testing Java, winter semester

Software Quality. Martin Glinz. Thomas Fritz. Lecture 7 UI Design, Usability & Testing. Many thanks to Meghan Allen and Daniel Greenblatt.

Lab 4. D0010E Object-Oriented Programming and Design. Today s lecture. GUI programming in

Lecture 5: Java Graphics

Heuristic Evaluation

Packages: Putting Classes Together

Usability in Multimedia. By Pınar Koçer Aydın and Özgür Bayram

Heuristic Evaluation of Covalence

CSE wi Final Exam 3/12/18 Sample Solution

Overview of Eclipse Lectures. Module Road Map

Selected Java Topics

CSE 440: Introduction to HCI User Interface Design, Prototyping, and Evaluation

Object-oriented programming in Java (2)

MEAP Edition Manning Early Access Program Get Programming with Java Version 1

Structure of Programming Languages Lecture 10

Craigslist Heuristic Evaluation

CS 335 Lecture 02 Java Programming

Severity Definitions:

Lecture 1: Overview of Java

CS 147 Autumn 2017: Assignment 9 (Heuristic Evaluation Group Template) Instructor: James Landay. Fix: make web also block the desktop screen.

CHAPTER 1: A GENERAL INTRODUCTION TO PROGRAMMING 1

Lecture Notes CPSC 224 (Spring 2012) Today... Java basics. S. Bowers 1 of 8

1001ICT Introduction To Programming Lecture Notes

CSE 331 Software Design & Implementation

Transcription:

Course Name: Advanced Java

Lecture 18 Topics to be covered Java Swing Introduction

What is Java Swing? Part of the Java Foundation Classes (JFC) Provides a rich set of GUI components Used to create a Java program with a graphical user interface (GUI) table controls, list controls, tree controls, buttons, and labels, and so on

What features are available? GUI components like button, checkbox, and so on Java 2D API: images, figures, animation Pluggable look and feel: use samples or create your own Data Transfer: cut, copy, paste, drag & drop Internationalization: supports different input language, right to left reading Accessibility API: for people with disabilities Undo Framework API: supports unlimited numbers of actions to undo and redo Flexible Deployment: run within a browser as an applet or Java Web Start

How does HelloWorld look like? import javax.swing.*; public class HelloWorldSwing { private static void createandshowgui() { //Create and set up the window. JFrame frame = new JFrame("HelloWorldSwing"); frame.setdefaultcloseoperation(jframe.exit_on_close); //Add the ubiquitous "Hello World" label. JLabel label = new JLabel("Hello World"); frame.getcontentpane().add(label); //Display the window. frame.pack(); frame.setvisible(true); }

public static void main(string[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.swingutilities.i nvokelater(new Runnable() { public void run() { createandshowgui(); } }); } }

Who are users? Since we are evaluating user interface toolkit itself, in this case Java Swing, users will be software developers, not software users I believe that most Java developers use Eclipse as their developing platform so we will evaluate Java Swing with Eclipse based on ten usability heuristics by Jakob Nielson

1. Visibility of system status This may be a strong advantage of Java Swing over other UI toolkits, not because of Java Swing itself is great, but because Eclipse provides such sophisticated checking on what is going on now Constantly checks for syntax errors Lists available methods or variables when press. (dot) However, you don t have synchronous result view You will have to run it in order to see the status of your program

2. Match between system and the real world First of all, it is Java It follows Java convention It consists of 18 public packages of Java classes Its classes and methods are reasonably named Unless you are the first time programmer, you don t have to worry about its syntax or convention JLabel developernamelabel = new javax.swing.jlabel(); developernamelabel.setfont(new java.awt.font("arial", 0, 14)); developernamelabel.setforeground(new java.awt.color(255, 255, 255));

3. User control and freedom Eclipse supports strong undo and redo features You can t possibly go wrong and have to rewrite every code You can always fix it even though it may take you some effort and time Java Swing also provides undo and redo package javax.swing.event.undoableeditevent; javax.swing.event.undoableeditlistener; javax.swing.undo.undoableedit;

4. Consistency and standards Similar to #2 Java Swing follows Java convention Packages, classes, methods, parameters, variables Mainly constructor, getter, setter

5. Error prevention First of all, Java is a strongly typed language: primitives and objects Eclipse checks for syntax and type errors continuously It gives red underline to errors and small red box to let you know which line in document it is located If you move your mouse over the error, then it suggests possible solutions to the error If you think one of the suggestions is a solution, then simply click on it to apply it Of course, it won t compile and run until you fix all the syntax errors However, you don t have any idea about runtime errors except that you will have to run it and find

6. Recognition rather than recall It s a programming language, so it s better and faster for you if you memorize names and their functions of classes or methods However, whenever you press dot after name of package, class, or object, then eclipse provides you a list of all possible subclasses, functions and variables If you move your mouse over almost anything, then eclipse provides you with a text document associated with it, usually javadoc, or you can click on it and it directs you to online javadoc page You don t have a help of graphical interface to develop a graphical interface, so it maybe a disadvantage of Java Swing with eclipse. By the way, you can have a graphical interface if you use NetBeans IDE instead of eclipse

7. Flexibility and efficiency of use Swing includes many basic components as a package, so it is efficient to use them At the same time, you can create almost anything you want as combination of those components and some pure coding in Java Java have had a reputation for being slower and requiring more memory than those written in natively compiled languages such as C or C++ However, the performance heavily depends on how you optimize your codes and which components of UI you use the most frequently It may be subsequently slower or faster

8. Aesthetic and minimalist design Swing is designed in a way that it provides a set of "lightweight" (all-java language) components that, to the maximum degree possible, work the same on all platforms It includes almost only and all components we could find around any software with user interface Yet, it gives developers varieties to customize those components

9. Help users recognize, diagnose, and recover from errors Syntax and type checking errors are already covered previously Java shows where in the code runtime errors (exceptions) are caused, specifying line numbers and brief reason for error on the console of eclipse It s not always right, but most of the times it is right It s relatively easy to find the cause of the error and debug it comparing to other languages I have experienced with

10. Help and documentation Javadoc Eclipse s support for javadoc (already covered)

Conclusion Java Swing is easier to learn than others because it s Java You can use any helpful tools out there that are for Java development like eclipse IDE, NetBeans IDE Lacks live graphical and interactive help while developing Has unlimited possibilities depending on how you implement your software