Java 2 Swing B.Ramamurthy 5/1/2019 B.Ramamurthy.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming
Advertisements

JAVA API (GUI) Subject:T0934 / Multimedia Programming Foundation Session:1 Tahun:2009 Versi:1/0.
User Interface Design CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
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.
June 1, 2000 Object Oriented Programming in Java (95-707) Advanced Topics 1 Lecture 9 Object Oriented Programming in Java Advanced Topics Abstract Windowing.
Lecture 24 Applets. Introduction to Applets Applets should NOT have main method but rather init, stop, paint etc They should be run through javac compiler.
CS3157 Java UI Recitation. Material Covered: Overview of AWT components, Event Handling, creating applets, and sample UI. Not covered in recitation: Drawing,
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.
JAVA ENVIRONMENT JDK, API, JVM. JAVA ENVIRONMENT  Java environment includes development tools and many classes and methods. Java Environment JDK (Java.
GUI Programming in Java Tim McKenna GUI Programming Concepts l conventional programming: sequence of operations is determined by the program.
Introduction to the JDK Java for Computational Finance
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.
Introduction to Java Programming. Contents 1. Java, etc. 2. Java's Advantages 3. Java's Disadvantages 4. Types of Java Code 5. Java Bytecodes 6. Steps.
GUI Programming in Java
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
JAPPLET.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Object Oriented Programming Ders 11: Interfaces Mustafa Emre İlal
Java Applets. 2 Introduction to Java Applet Programs  Applications are stand alone programs executed with Java interpreter executed with Java interpreter.
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.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
Java Programming: Advanced Topics 1 Common Elements of Graphical User Interfaces Chapter 6.
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Introduction to Applets Course Lecture Slides 29 th July 2010.
Chapter 13Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 13 l HTML l Applets Applets and HTML.
Objectives of This Session
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.
GUIs in Java Swing, Events CS2110, SW Development Methods Readings: MSD, Chapter 12 Lab Exercise.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
CS Lecture 00 Swing overview and introduction Lynda Thomas
Java Programming: Advanced Topics 1 Components and Facilities for Rich Graphical User Interfaces Chapter 7.
SWING 101. IF YOU GET LOST - IMPORTANT LINKS  Swing articles:
CSCI Swing1 The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness –The Abstract.
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.
Java Programming Applets. Topics Write an HTML document to host an applet Understand simple applets Use Labels with simple AWT applets Write a simple.
9.1 Java Packages A collection of classes Allows classes to be grouped arbitrarily Hierarchical structure independent of inheritance Classes can.
Swing / Session1 / 1 of 30 Module Introduction Distributed Computing in Java.
Javadoc. Purpose of javadoc javadoc is a program that reads your Java program and produces great-looking documentation in HTML format Without any help,
Swing - 2 Session 13. Swing - 2 / 2 of 38 Objectives (1) Discuss trees and tables Discuss progress bars Discuss MVC architecture Describe menus.
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.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
Lecture 261 CS110 Lecture 26 Thursday, May 6, 2004 This lecture not delivered from slides Announcements –final exam Thursday, May 20, 8:00 AM McCormack,
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 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.
Welcome To java
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Advanced Programing practices
Provision for GUIs in Java
Lecture 09 Applets.
University of Central Florida COP 3330 Object Oriented Programming
Introduction to Advanced Java Programming
Provision for GUIs in Java
1. Introduction to Visual Basic
Event Driven Programming and Graphical User Interface
Java Applets.
Week 8 Swing NetBeans GUI Builder
Advanced Programing practices
F II 1. Background Objectives
Chap 1. Getting Started Objectives
Review of Previous Lesson
Presentation transcript:

Java 2 Swing B.Ramamurthy 5/1/2019 B.Ramamurthy

Topics for Discussion Review Abstract Window Toolkit JDK1.2 Additions Java Foundation classes Collection classes Swing Package Swing Demo Summary 5/1/2019 B.Ramamurthy

Review of AWT (partial list) Component CheckBox Button TextComponent Container MenuComponent TextField TextArea Menu MenuBar MenuItem Panel Window Applet Frame Dialog 5/1/2019 B.Ramamurthy

JDK1.2 Additions JFC java2D(3D) AWT Drag&Drop Swing Accessibility (Speech, Sight API) Collection classes Bug fixes JDK1.2 changes 5/1/2019 B.Ramamurthy

Swing package Swing provides components for developing UI and event (user) driven applications. EX; menus, toolbars, etc. Swing is a major enhancement of AWT. Can AWT and Swing coexist? YES How is Swing component different from an AWT component? 5/1/2019 B.Ramamurthy

Swing Component Two distinguishing characteristics are : 1. It supports pluggable Look and Feel. Besides run-anywhere, appearance of a component may be changed at run-time to look and feel like the system on which it is running. 2. Swing components are Lightweight components: they do not dependent on any native system classes. 5/1/2019 B.Ramamurthy

Speed Issue When using java Speed is an important issue to be concerned with. Right now Java is slow: Suggestions for improvement in your environment: 1. Faster hardware 2. Speed up techniques: Speed up JVM, use JIT (just in Time compiler) to by pass JVM when ever acceptable. 3. Use lightweight components 5/1/2019 B.Ramamurthy

Software/Hardware Push/Pull demand Software Hardware supply EX: 1000Mhz intel CPU 5/1/2019 B.Ramamurthy

Lightweight Components Motivation for lightweight components is two-fold: run-anywhere, speedup application 1. Lightweight 2. Normal 3. Bypass JVM; Use Native code ( JIT) Button 3 1 2 JVM Operating System 5/1/2019 B.Ramamurthy

Swing Lineage java.lang.Object java.awt.Component java.awt.Container java.Swing.JComponent Note : This is my approach to studying a class/package. Exploring the lineage should be the starting point 5/1/2019 B.Ramamurthy

Swing Components (controls) JApplet JButton JCheckBox JTable JTextPane JSlider JTree JPopupMenu Jtooltip JScrollBar JScrollPane JDialog JMenuBar etc. Note : J prefix to distinguish it from regular AWT components. 5/1/2019 B.Ramamurthy

Swing Demo Lets see what it offers through a demo. This is available in : jdk1.2/demo/jfc/SwingSet/SwingSetApplet.java 5/1/2019 B.Ramamurthy

Java Development Kit (JDK 1.2) Supports development of applications in Java by providing packages of classes to accomplish various commonly used functions, their complete source code, documentation for the API (application programmer’s interface). Tools : compiler (javac), runtime (java, appletviewer), documentation generator (javadoc) 5/1/2019 B.Ramamurthy

Javadoc Parses declarations and documentation comments in a set of Java source files and produces a set of HTML pages describing the public and protected classes, interfaces, constructors, methods and fields. Generates one .html file for each .java file and each package. Also generates a class hierarchy (tree.html) and index files of the members (AllNames.html) 5/1/2019 B.Ramamurthy

Commenting the Source Code All comments with the format given below and immediately before a class, interface, method or field is recognized and used by javadoc. Format /** * This class is for running the show * This is next line * This is another line of comment */ 5/1/2019 B.Ramamurthy

How to use Javadoc? After your application is ready for deployment, run it through javadoc to generate the programmer’s manual : javadoc {options} java source file names/package names A complete hypertext version of programmer’s manual for your application will be ready in minutes. 5/1/2019 B.Ramamurthy

Browse through Javadoc generated documentation? Javadoc generated documents usually start off at an index.html. Use any html browser to open up this file associated with the application and follow the links. 5/1/2019 B.Ramamurthy

Summary Discussed salient features of Swing. AWT and Swing components may co-exist. Swing offers LookAndFeel of host environment and lightweight components. Discussed use of Javadoc tool for preparing documentation for applications. 5/1/2019 B.Ramamurthy