SlideShare ist ein Scribd-Unternehmen logo
1 von 35
A Simple Applet
[object Object],[object Object],[object Object],[object Object]
Applets and applications ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Packages and classes ,[object Object],[object Object],[object Object],[object Object],[object Object]
The  Applet   class ,[object Object],[object Object],[object Object],[object Object],[object Object]
Importing the  Applet   class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The   java.awt   package ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Importing the  java.awt  package ,[object Object],[object Object],[object Object],[object Object]
C and C++ programmers only ,[object Object],[object Object],[object Object],[object Object],[object Object]
The applet so far import java.applet.Applet; import java.awt.*;
Comments ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Your first class ,[object Object],[object Object],[object Object],[object Object],[object Object]
Your first class, part 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Your first class, part 3 ,[object Object],[object Object]
The applet so far import java.applet.Applet; import java.awt.*; // CIT 591 example public class Drawing extends Applet { … we still need to put some code in here... }
Methods ,[object Object],[object Object],[object Object],[object Object],[object Object]
The  paint  method ,[object Object],[object Object],[object Object],[object Object],[object Object]
The  paint  method, part 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
By the way…names ,[object Object],[object Object],[object Object]
The  paint  method, part 3 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Classes and objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The  paint  method, part 4 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The applet so far import java.applet.Applet; import java.awt.*; // CIT 591 example public class Drawing extends Applet { public void paint(Graphics g) {   …we still need to put some code in here…   } }
Colors ,[object Object],[object Object],[object Object],Color.BLACK Color.PINK  Color.GREEN Color.DARK_GRAY Color.RED Color.CYAN Color.GRAY Color.ORANGE Color.BLUE Color.LIGHT_GRAY Color.YELLOW Color.WHITE  Color.MAGENTA
New colors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Setting a color ,[object Object],[object Object],[object Object]
The  paint  method so far public void paint(Graphics g) {   g.setColor(Color.BLUE);   …draw a rectangle…   g.setColor(Color.RED);   …draw another rectangle…     } }
Pixels ,[object Object],[object Object],[object Object],[object Object]
Java’s coordinate system ,[object Object],[object Object],[object Object],[object Object],[object Object],(0, 0) (0, 20) (50, 0) (50, 20) (w-1, h-1)
Drawing rectangles ,[object Object],[object Object],[object Object]
The complete applet import java.applet.Applet; import java.awt.*; // CIT 591 example public class Drawing extends Applet { public void paint(Graphics g) { g.setColor(Color.BLUE);   g.fillRect(20, 20, 50, 30);   g.setColor(Color.RED);   g.fillRect(50, 30, 50, 30);   } }
Some more  java.awt  methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Drawing Strings ,[object Object],[object Object],[object Object],[object Object],[object Object]
The End

Weitere ähnliche Inhalte

Was ist angesagt?

Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
Abha Damani
 
Abstract & Interface
Abstract & InterfaceAbstract & Interface
Abstract & Interface
Linh Lê
 
A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editing
Dr. Jan Köhnlein
 
WPF Graphics and Animations
WPF Graphics and AnimationsWPF Graphics and Animations
WPF Graphics and Animations
Doncho Minkov
 

Was ist angesagt? (20)

Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++
 
A Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingA Unified View of Modeling and Programming
A Unified View of Modeling and Programming
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
Machine learning in php Using PHP-ML
Machine learning in php Using PHP-MLMachine learning in php Using PHP-ML
Machine learning in php Using PHP-ML
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
Abstract & Interface
Abstract & InterfaceAbstract & Interface
Abstract & Interface
 
C++ Training
C++ TrainingC++ Training
C++ Training
 
2011 10-24-initiatives-tracker-launch-v1.0
2011 10-24-initiatives-tracker-launch-v1.02011 10-24-initiatives-tracker-launch-v1.0
2011 10-24-initiatives-tracker-launch-v1.0
 
A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editing
 
Structure of C++ - R.D.Sivakumar
Structure of C++ - R.D.SivakumarStructure of C++ - R.D.Sivakumar
Structure of C++ - R.D.Sivakumar
 
Diving in OOP (Day 6): Understanding Enums in C# (A Practical Approach)
Diving in OOP (Day 6): Understanding Enums in C# (A Practical Approach)Diving in OOP (Day 6): Understanding Enums in C# (A Practical Approach)
Diving in OOP (Day 6): Understanding Enums in C# (A Practical Approach)
 
WPF Graphics and Animations
WPF Graphics and AnimationsWPF Graphics and Animations
WPF Graphics and Animations
 
Practical Models in Practice
Practical Models in PracticePractical Models in Practice
Practical Models in Practice
 
Basic structure of C++ program
Basic structure of C++ programBasic structure of C++ program
Basic structure of C++ program
 
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
 
01. introduction to C++
01. introduction to C++01. introduction to C++
01. introduction to C++
 
Overview of c++ language
Overview of c++ language   Overview of c++ language
Overview of c++ language
 
Bcsl 031 solve assignment
Bcsl 031 solve assignmentBcsl 031 solve assignment
Bcsl 031 solve assignment
 

Andere mochten auch (13)

श्री जवाहर लाल नेहरू भारत के प्रधानमंत्री
श्री जवाहर लाल नेहरू   भारत के प्रधानमंत्रीश्री जवाहर लाल नेहरू   भारत के प्रधानमंत्री
श्री जवाहर लाल नेहरू भारत के प्रधानमंत्री
 
श्री चन्द्र शेखर भारत के प्रधानमंत्री
श्री चन्द्र शेखर   भारत के प्रधानमंत्रीश्री चन्द्र शेखर   भारत के प्रधानमंत्री
श्री चन्द्र शेखर भारत के प्रधानमंत्री
 
Química
QuímicaQuímica
Química
 
AWARD
AWARDAWARD
AWARD
 
Individual photo analysis
Individual photo analysisIndividual photo analysis
Individual photo analysis
 
White privileges.
White privileges.White privileges.
White privileges.
 
Pidsdps9713(1)
Pidsdps9713(1)Pidsdps9713(1)
Pidsdps9713(1)
 
Final Layout- YHM Winter Feb 2016
Final Layout- YHM Winter Feb 2016Final Layout- YHM Winter Feb 2016
Final Layout- YHM Winter Feb 2016
 
Nueva identidad grafica Pastoral Educativa
Nueva identidad grafica Pastoral EducativaNueva identidad grafica Pastoral Educativa
Nueva identidad grafica Pastoral Educativa
 
Kertas Kerja Lagu Baru SK Skarok | April 2016
Kertas Kerja Lagu Baru SK Skarok | April 2016Kertas Kerja Lagu Baru SK Skarok | April 2016
Kertas Kerja Lagu Baru SK Skarok | April 2016
 
Teks ucapan hari guru
Teks ucapan hari guruTeks ucapan hari guru
Teks ucapan hari guru
 
A New Model for Family Law
A New Model for Family LawA New Model for Family Law
A New Model for Family Law
 
Colegio de bachilleres plantel 28
Colegio de bachilleres plantel 28Colegio de bachilleres plantel 28
Colegio de bachilleres plantel 28
 

Ähnlich wie Applets - lev' 2

Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
backdoor
 
Applets 101-fa06
Applets 101-fa06Applets 101-fa06
Applets 101-fa06
nrayan
 
Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01
Abhishek Khune
 

Ähnlich wie Applets - lev' 2 (20)

first-applet
first-appletfirst-applet
first-applet
 
Graphics programming in Java
Graphics programming in JavaGraphics programming in Java
Graphics programming in Java
 
Applet in java new
Applet in java newApplet in java new
Applet in java new
 
GUI.pdf
GUI.pdfGUI.pdf
GUI.pdf
 
Java Applet
Java AppletJava Applet
Java Applet
 
Applet and graphics programming
Applet and graphics programmingApplet and graphics programming
Applet and graphics programming
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
 
Smart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdfSmart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdf
 
Smart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdfSmart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdf
 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Java
 
JAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdfJAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdf
 
Java applets
Java appletsJava applets
Java applets
 
27 applet programming
27  applet programming27  applet programming
27 applet programming
 
Basic of Applet
Basic of AppletBasic of Applet
Basic of Applet
 
Introduction to Java Applets
Introduction to Java AppletsIntroduction to Java Applets
Introduction to Java Applets
 
Java: Java Applets
Java: Java AppletsJava: Java Applets
Java: Java Applets
 
Applets 101-fa06
Applets 101-fa06Applets 101-fa06
Applets 101-fa06
 
Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01
 
Applets
AppletsApplets
Applets
 
oops with java modules iii & iv.pptx
oops with java modules iii & iv.pptxoops with java modules iii & iv.pptx
oops with java modules iii & iv.pptx
 

Mehr von Rakesh T (8)

"Thirakatha" Movie Review
"Thirakatha" Movie Review"Thirakatha" Movie Review
"Thirakatha" Movie Review
 
WED - 2011
WED -  2011WED -  2011
WED - 2011
 
IGNOU - Prospectus
IGNOU - ProspectusIGNOU - Prospectus
IGNOU - Prospectus
 
Proshow Gold
Proshow GoldProshow Gold
Proshow Gold
 
Proshow gold
Proshow goldProshow gold
Proshow gold
 
Applets - Lev' 1
Applets - Lev' 1Applets - Lev' 1
Applets - Lev' 1
 
Boardingplanes
BoardingplanesBoardingplanes
Boardingplanes
 
Calicut MCA Syllebus
Calicut MCA SyllebusCalicut MCA Syllebus
Calicut MCA Syllebus
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Applets - lev' 2

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. The applet so far import java.applet.Applet; import java.awt.*;
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. The applet so far import java.applet.Applet; import java.awt.*; // CIT 591 example public class Drawing extends Applet { … we still need to put some code in here... }
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. The applet so far import java.applet.Applet; import java.awt.*; // CIT 591 example public class Drawing extends Applet { public void paint(Graphics g) { …we still need to put some code in here… } }
  • 25.
  • 26.
  • 27.
  • 28. The paint method so far public void paint(Graphics g) { g.setColor(Color.BLUE); …draw a rectangle… g.setColor(Color.RED); …draw another rectangle… } }
  • 29.
  • 30.
  • 31.
  • 32. The complete applet import java.applet.Applet; import java.awt.*; // CIT 591 example public class Drawing extends Applet { public void paint(Graphics g) { g.setColor(Color.BLUE); g.fillRect(20, 20, 50, 30); g.setColor(Color.RED); g.fillRect(50, 30, 50, 30); } }
  • 33.
  • 34.