Java Swing Joon Ho Cho. What is Java Swing? Part of the Java Foundation Classes (JFC) Provides a rich set of GUI components Used to create a Java program.

Slides:



Advertisements
Similar presentations
DEVELOPING A METHODOLOGY FOR MS3305 CW2 Some guidance.
Advertisements

1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 22 GUI Programming I.
Outline Modified rating scale Heuristic evaluation.
1 GWT Google Web Toolkit Build AJAX apps in the Java language
11 HCI - Lesson 5.1 Heuristic Inspection (Nielsen’s Heuristics) Prof. Garzotto.
Part 4: Evaluation Days 25, 27, 29, 31 Chapter 20: Why evaluate? Chapter 21: Deciding on what to evaluate: the strategy Chapter 22: Planning who, what,
Heuristic Evaluation. Sources for today’s lecture: Professor James Landay: stic-evaluation/heuristic-evaluation.ppt.
Writing GUI Applications An introduction with Java.
Object-Oriented Software Engineering Java with added Swing.
Heuristic Evaluation.
PART A Emac Lisp   Emac Lisp is a programming language  Emacs Lisp is a dialect.
Evaluate the Usability of a User Interface Tool or Toolkit Assignment 1 Assignment 1 Evaluate the Usability of a User Interface Tool or Toolkit T. H Ranasinghe.
Heuristic evaluation IS 403: User Interface Design Shaun Kane.
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Graphical User Interface (GUI) Design using Swing Course Lecture Slides.
GUI Basics: Introduction. Creating GUI Objects // Create a button with text OK JButton jbtOK = new JButton("OK"); // Create a label with text "Enter your.
Introduction to Java GUI Creating Graphical User Interfaces © copyright Bobby Hoggard / material may not be redistributed without permission.
Applets, AWTS CompSci 230 Software Construction.
Tool name : Firebug A URL for more information about the tool, or where to buy or download it : Firebug is.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Software Construction Lecture 10 Frameworks
Intro to Java 2 By Geb Thomas Based on the Java TutorialJava Tutorial.
Intro to GUIs (Graphical User Interfaces) Section 2.5Intro. to GUIs: a GUI Greeter Section 3.7Graphical/Internet Java: Einstein's Equation.
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
User Interface Design Session 11- LBSC 790 / INFM 718B Building the Human-Computer Interface Cartoon removed.
Nielsen’s Ten Usability Heuristics
Usability Expert Review Anna Diubina. What is usability? The effectiveness, efficiency and satisfaction with which specified users achieve specified goals.
Multimedia Specification Design and Production 2012 / Semester 1 / week 5 Lecturer: Dr. Nikos Gazepidis
Java GUI CSCE 190 – Java Instructor: Joel Gompert Mon, July 26, 2004.
Lab 6: Shapes & Picture Extended Ellipse & Rectangle Classes Stand-Alone GUI Applications.
Design 2 (Chapter 5) Conceptual Design Physical Design Evaluation
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.
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
FEN IntroJava2006 AAU1 GUI: Graphical User Interface AWT/SWING: Components Drag and Drop in NetBeans Events Listeners.
1 Graphical User Interfaces AWT and Swing packages Frames and Panels Components Nested Panels Images Reading for this Lecture: L&L, 3.9 – 3.11.
AUIS Assignment 01 IT Part A Visual Studio IDE   Developing IDE from Microsoft.
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.
Usability 1 Usability evaluation Without users - analytical techniques With users - survey and observational techniques.
Developed by Tim Bell Department of Computer Science and Software Engineering University of Canterbury Human Computer Interaction.
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.
Creating Windows. How can we use Java to create programs that use windows (GUI applications)? How can we use Java to create programs that use windows.
 GUI – Graphic User Interface  Up to now in the programs we have written all output has been sent to the standard output device i.e.: the DOS console.
Java GUI. Graphical User Interface (GUI) a list a button a text field a label combo box checkbox.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming – Home and reload buttons for the webbrowser, Applets.
Heuristic Evaluation Short tutorial to heuristic evaluation
Swing. Introduction to Swing What is Swing? “ Swing is a diverse collection of lightweight components that can be used to build sophisticated user interfaces.”
Usability Heuristics Avoid common design pitfalls by following principles of good design Nielsen proposes 10 heuristics, others propose more or less. Inspect.
Lecture # 6 Graphical User Interface(GUI). Introduction A graphical user interface (GUI) presents a user- friendly mechanism for interacting with an application.
Ten Usability Heuristics with Example.. Page 2 Heuristic Evaluation Heuristic evaluation is the most popular of the usability inspection methods. Heuristic.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
COGNITIVE WALKTHROUGH Vigneshwar Poojar. The cognitive walkthrough is a formalized way of imagining people’s thoughts and actions when they use an interface.
ITP 109 Week 2 Trina Gregory Introduction to Java.
APPLE MAPS FOR APP Heuristic Evaluation By Rayed Alakhtar.
© 2016 Cognizant. © 2016 Cognizant Introduction PREREQUISITES SCOPE Heuristic evaluation is a discount usability engineering method for quick, cheap,
Lesson 2: First Java Programs. 2.1 Why Java? Java is one of the most popular programming languages in the world. Java is a modern object-oriented programming.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
CREATING A SIMPLE GUI Mr. Crone. First GUI Today we will use Swing to create the following application:
Ten Usability Heuristics These are ten general principles for user interface design. They are called "heuristics" because they are more in the nature of.
Using NetBeans IDE for Desktop Development Geertjan Wielenga
Welcome To java
User Interface Design SCMP Special Topic: Software Development
Game Engine Architecture
Game Engine Architecture
Unit 14 Website Design HND in Computing and Systems Development
One-timer?. A new face of the technical communicator – UX is our strength – we design to write.
(Computer fundamental Lab)
Nilesen 10 hueristics.
Presentation transcript:

Java Swing Joon Ho Cho

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.invokeLater(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 out

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