Cours de Java. Sciences-U Lyon. Java - Introduction Java - Fondamentaux Java Avancé. http://www.rzo.free.fr



Similar documents
Using NetBeans IDE for Desktop Development. Geertjan Wielenga

The Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC).

Java is commonly used for deploying applications across a network. Compiled Java code

Langages Orientés Objet Java

POB-JAVA Documentation

Remote Method Invocation

Technical Service Bulletin

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

Liste d'adresses URL

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index:

Thursday, February 7, DOM via PHP

CSS : petits compléments

Swing. A Quick Tutorial on Programming Swing Applications

Licence Informatique Année Exceptions

Fondamenti di Java. Introduzione alla costruzione di GUI (graphic user interface)

Using A Frame for Output

Advanced Network Programming Lab using Java. Angelos Stavrou

GUIs with Swing. Principles of Software Construction: Objects, Design, and Concurrency. Jonathan Aldrich and Charlie Garrod Fall 2012

CS 335 Lecture 06 Java Programming GUI and Swing

Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS)

Introduction au BIM. ESEB Seyssinet-Pariset Economie de la construction contact@eseb.fr

Les fragments. Programmation Mobile Android Master CCI. Une application avec deux fragments. Premier layout : le formulaire

Power Distribution System. Additional Information on page 2 See Page 2 Page 6. Eaton. See Page 2. Additional Information on page 2

@ - Internal # - Online TH PR OR TW TOTAL HOURS # @ 175

Sun Management Center Change Manager Release Notes

Personnalisez votre intérieur avec les revêtements imprimés ALYOS design

5.17 GUI. Xiaoyi Jiang Informatik I Grundlagen der Programmierung

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 7: Object-Oriented Programming. Introduction

TP #4 b. ClientBourse.java Classe principale du client graphique et fonction main.

RAPPORT FINANCIER ANNUEL PORTANT SUR LES COMPTES 2014

TP N 10 : Gestion des fichiers Langage JAVA

Solaris 10 Documentation README

Les Broadcast Receivers...

AD511 Active Iridium Antenna User Manual Mar 12 V4.0

Sélection adaptative de codes polyédriques pour GPU/CPU

Regulatory Compliance Statement

Repris de : Version Debian (de base)

How To Write A Program In Java (Programming) On A Microsoft Macbook Or Ipad (For Pc) Or Ipa (For Mac) (For Microsoft) (Programmer) (Or Mac) Or Macbook (For

TP : Système de messagerie - Fichiers properties - PrepareStatement

GUI Event-Driven Programming

Aucune validation n a été faite sur l exemple.

Essentials of the Java(TM) Programming Language, Part 1

READ AND FOLLOW ALL SAFETY INSTRUCTIONS 1. DANGER RISK OF SHOCK DISCONNECT POWER BEFORE INSTALLATION

Brazil + JDBC Juin 2001, douin@cnam.fr

SunFDDI 6.0 on the Sun Enterprise Server

SUN SEEBEYOND ebam STUDIO RELEASE NOTES. Release 5.1.2

TP JSP : déployer chaque TP sous forme d'archive war

Short Form Description / Sommaire: Carrying on a prescribed activity without or contrary to a licence

Tool & Asset Manager 2.0. User's guide 2015

Créer une carte. QGIS Tutorials and Tips. Author. Ujaval Gandhi Translations by

HEALTH CARE DIRECTIVES ACT

Principles of Software Construction: Objects, Design and Concurrency. GUIs with Swing. toad Spring 2013

Direct AC Wiring Option Installation Guide

Extending Desktop Applications to the Web

Configuration Guide. SafeNet Authentication Service. SAS Agent for AD FS

Machine de Soufflage defibre

SUN SEEBEYOND egate INTEGRATOR RELEASE NOTES. Release 5.1.1

TABLECLOTHS TEMPLATES


«Object-Oriented Multi-Methods in Cecil» Craig Chambers (Cours IFT6310, H08)

Introduction. GEAL Bibliothèque Java pour écrire des algorithmes évolutionnaires. Objectifs. Simplicité Evolution et coévolution Parallélisme

Sun Management Center 3.5 Update 1b Release Notes

N1 Grid Service Provisioning System 5.0 User s Guide for the Linux Plug-In

Essentials of the Java Programming Language

The Register of the Domain of the State A Revolution in the Registration of Land Rights

Java SE 6 Update 10. la piattaforma Java per le RIA. Corrado De Bari. Sun Microsystems Italia Spa. Software & Java Ambassador

Interfaces de programmation pour les composants de la solution LiveCycle ES (juillet 2008)

Nexawebホワイトペーパー. Developing with Nexaweb ~ Nexaweb to Improve Development Productivity and Maintainability

ACP-EU Cooperation Programme in Science and Technology (S&T II) / Programme de Coopération ACP-UE pour la Science et la Technologie

In-Home Caregivers Teleconference with Canadian Bar Association September 17, 2015

RÉPONSE DE ÉNERGIE LA LIÈVRE S.E.C. ET D ÉNERGIE BROOKFIELD MARKETING INC. À LA DEMANDE DE RENSEIGNEMENT N o 1 DE LA RÉGIE DE L ÉNERGIE («RÉGIE»)

Proposition d intervention

Administrer les solutions Citrix XenApp et XenDesktop 7.6 CXD-203

Introduction à EMF Eclipse Modeling Framework

Tutorial: Time Of Day Part 2 GUI Design in NetBeans

ANIMATION OF CONTINUOUS COMPUTER SIMULATIONS C.M. Woodside and Richard Mallet Computer Center, Carleton University ABSTRACT

AgroMarketDay. Research Application Summary pp: Abstract

Introduction ToIP/Asterisk Quelques applications Trixbox/FOP Autres distributions Conclusion. Asterisk et la ToIP. Projet tuteuré

Sun StorEdge A5000 Installation Guide

Sun StorEdge Availability Suite Software Point-in-Time Copy Software Maximizing Backup Performance

Memory Eye SSTIC Yoann Guillot. Sogeti / ESEC R&D yoann.guillot(at)sogeti.com

Fachbereich Informatik und Elektrotechnik Java Swing. Advanced Java. Java Swing Programming. Programming in Java, Helmut Dispert

OCC1 546 STRATEGIES IN OCCUPATIONAL THERAPY PROFESSIONAL PRACTICE

Switching Power Supply XP POWER INC. SUITE 150, 1241 E DYER RD SANTA ANA CA 92705, USA XP POWER INC SUITE 150, 1241 E DYER RD SANTA ANA CA 92705, USA

Calcul parallèle avec R

TP : Configuration de routeurs CISCO

Account Manager H/F - CDI - France

General Certificate of Education Advanced Level Examination June 2012

Graphical User Interfaces

Archived Content. Contenu archivé

ProjectWebSynergy Milestone 4 Release Notes

Detection of water leakage using laser images from 3D laser scanning data

How To Start A Glassfish V3 Application Server Quick Start (Windows) On A Microsoft Server (Windows 7)

site et appel d'offres

System Requirements Orion

Solaris 9 9/05 Installation Roadmap

Transcription:

Cours de Java Sciences-U Lyon Java - Introduction Java - Fondamentaux Java Avancé http://www.rzo.free.fr Pierre PARREND 1 Octobre 2004

Sommaire Java Introduction Java Fondamentaux Java Avancé GUI Graphical User Interface - Swing Pierre PARREND 2 Octobre 2004

Présentation Eléments de Swing Le Design Pattern MVC Pierre PARREND 3 Octobre 2004

Types d'applications Stand-Alone cf. TD Applet Java Web Start Permet le chargement dynamique de classes (code mobile) Transparent pour l'utilisateur Exemple : http://java.sun.com/products/javawebstart/demos.html Pierre PARREND 4 Octobre 2004

JFC (Java Foundation Classes) Interfaces graphiques et interactivité Swing Look & Feel adaptable Accessibilité (support du Braille) Java 2D API (applications, applets, impression) Support du drag and Drop Internationalisation Pierre PARREND 5 Octobre 2004

JFC (Java Foundation Classes) j2sdk 1.4 javax.accessibility javax.swing.plaf javax.swing.text.html javax.swing javax.swing.plaf.basic javax.swing.text.parser javax.swing.border javax.swing.plaf.metal javax.swing.text.rtf javax.swing.colorchooser javax.swing.plaf.multi javax.swing.tree javax.swing.event javax.swing.table javax.swing.undo javax.swing.filechooser javax.swing.text Pierre PARREND 6 Octobre 2004

Ce qu'on utilise javax.swing javax.swing.event Comment créer des GUI Fichiers Java IDE (NetBeans, Eclipse) Pierre PARREND 7 Octobre 2004

Exemple de code HelloWorldSwing Import des packages Définition Une fenêtre (Top-level Container) Options Elements de cette fenêtre Réalisation de l'interface : deux étapes distinctes Création Affichage Pierre PARREND 8 Octobre 2004

Exemple de code - HelloWorldSwing import javax.swing.*; public class HelloWorldSwing { /** * Create the GUI and show it. For thread safety, * this method should be invoked from the * event-dispatching thread. */ } private static void createandshowgui() { //Definition de l'interface graphique } public static void main(string[] args) { } //lancement de l'interface graphique createandshowgui(); Pierre PARREND 9 Octobre 2004

Exemple de code - HelloWorldSwing private static void createandshowgui() { //Decoration de la fenetre Jframe.setDefaultLookAndFeelDecorated(true); //Creation et configuration de la fenetre JFrame frame = new JFrame("HelloWorldSwing"); frame.setdefaultcloseoperation(jframe.exit_on_close); //Ajout du label "Hello World" JLabel label = new JLabel("Hello World"); frame.getcontentpane().add(label); } //Affiche la fenetre frame.pack(); frame.setvisible(true); Pierre PARREND 10 Octobre 2004

Exemple de code - HelloWorldSwing public static void main(string[] args) { //Prévision d'une action pour le thread de gestion // des évènements. //Creation et Affichage du GUI. { javax.swing.swingutilities.invokelater(new Runnable() }); public void run() { createandshowgui(); } } } Pierre PARREND 11 Octobre 2004

Présentation Eléments de Swing Le Design Pattern MVC Pierre PARREND 12 Octobre 2004

Elements de Swing Top-level Container JFrame fenêtre principale JDialog fenêtre secondaire JApplet - Applet Contiennent des composants Zone de texte Boutons, Checkboxes, Radio Buttons Navigation dans l'arborescence... Pierre PARREND 13 Octobre 2004

Elements de Swing Evènements Permet la communication entre les composants Emission Quand l'utilisateur clique sur la souris, ou entre un caractère Réception Tous les objets peuvent en être notifiés Pierre PARREND 14 Octobre 2004

Elements de Swing Evènements Implémentation Implémentation de l'interface Listener Implements ActionListener Enregistrement comme event Listener sur la source d'évenements button.addactionlistener(this); Implémentation des méthodes de l'interface Listener public void actionperformed(actionevent e) {...//code de réaction l'action } ) Pierre PARREND 15 Octobre 2004

Elements de Swing Evènements Types d'évènements Action qui provoque l'évènement Type de Listener Clic sur un bouton, Touche Entrer dans une zone de texte ou choix d'un item de menu ActionListener Fermeture d'un 'frame' (fenêtre principale) WindowListener Clic de souris quand le curseur est au-dessus d'un composant MouseListener Mouvement de la souris sur un composant MouseMotionListener Composant devient visible ComponentListener Composant prend le focus du clavier FocusListener Changement de selection dans une table ou une liste ListSelectionListener Pierre PARREND 16 Octobre 2004

Elements de Swing -Evènements Doivent s'exécuter rapidement Exécutés séquentiellement Dans le thread 'event.dispatching' Si un évènement est long à traité, l'application ne répond plus Pierre PARREND 17 Octobre 2004

Elements de Swing LookAndFeel Pierre PARREND 18 Octobre 2004

Présentation Eléments de Swing Le Design Pattern MVC Pierre PARREND 19 Octobre 2004

Le Design Pattern MVC Pierre PARREND 20 Octobre 2004

Bilan Pierre PARREND 21 Octobre 2004