SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
JAVA WEEK8(A)
/* Week 8 : a) Write a Java program for handling mouse events. */



import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
/*
< applet code="LabPro15"   width=300 height=100>
< /applet>
*/
public class LabPro15 extends Applet implements MouseListener
{
        String msg="welcome";int x=100,y=100;
        public void init()
        {
        addMouseListener(this);
        }
        public void paint(Graphics g)
        {
                g.drawString(msg,x,y);
        }
        public void update(Graphics g)
        {
                paint(g);
        }
        public void mouseClicked(MouseEvent e)
        {
        }
        public void mousePressed(MouseEvent e)
        {
                msg="to";x=150;y=150;
                repaint();
        }
        public void mouseReleased(MouseEvent e)
        {
                msg="gmrit";x=200;y=200;
                repaint();
        }
        public void mouseEntered(MouseEvent e)
        {
        }
        public   void mouseExited(MouseEvent e)
        {
        }
}




                                       Page 1

Mais conteúdo relacionado

Mais procurados

Ejercicios Scilab Completo
Ejercicios Scilab CompletoEjercicios Scilab Completo
Ejercicios Scilab CompletoRicardo Grandas
 
Tarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezTarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezSebastian Vasquez
 
The Ring programming language version 1.6 book - Part 59 of 189
The Ring programming language version 1.6 book - Part 59 of 189The Ring programming language version 1.6 book - Part 59 of 189
The Ring programming language version 1.6 book - Part 59 of 189Mahmoud Samir Fayed
 

Mais procurados (6)

Trabajo Scilab
Trabajo ScilabTrabajo Scilab
Trabajo Scilab
 
Taller De Scilab
Taller De ScilabTaller De Scilab
Taller De Scilab
 
Martha
MarthaMartha
Martha
 
Ejercicios Scilab Completo
Ejercicios Scilab CompletoEjercicios Scilab Completo
Ejercicios Scilab Completo
 
Tarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezTarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian Vasquez
 
The Ring programming language version 1.6 book - Part 59 of 189
The Ring programming language version 1.6 book - Part 59 of 189The Ring programming language version 1.6 book - Part 59 of 189
The Ring programming language version 1.6 book - Part 59 of 189
 

Destaque (6)

Java Week9(B) Notepad
Java Week9(B)   NotepadJava Week9(B)   Notepad
Java Week9(B) Notepad
 
Java Week10 Notepad
Java Week10   NotepadJava Week10   Notepad
Java Week10 Notepad
 
Java Week6(B) Notepad
Java Week6(B)   NotepadJava Week6(B)   Notepad
Java Week6(B) Notepad
 
Java Week4(B) Notepad
Java Week4(B)   NotepadJava Week4(B)   Notepad
Java Week4(B) Notepad
 
Java notes
Java notesJava notes
Java notes
 
Chronic And Acute Illness Lecture
Chronic And Acute Illness LectureChronic And Acute Illness Lecture
Chronic And Acute Illness Lecture
 

Semelhante a Java Week8(A) Notepad

Programa en java circulos
Programa en java circulosPrograma en java circulos
Programa en java circulosAnel Sosa
 
Please help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfPlease help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfJUSTSTYLISH3B2MOHALI
 
Task Write a Java program to implement a simple graphics editor tha.pdf
Task Write a Java program to implement a simple graphics editor tha.pdfTask Write a Java program to implement a simple graphics editor tha.pdf
Task Write a Java program to implement a simple graphics editor tha.pdfcronkwurphyb44502
 
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfimport java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfanyacarpets
 
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートIIopenFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートIIAtsushi Tadokoro
 
Automated testing of mobile applications on multiple platforms
Automated testing of mobile applications on multiple platformsAutomated testing of mobile applications on multiple platforms
Automated testing of mobile applications on multiple platformsjobandesther
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignmentAbdullah Al Shiam
 

Semelhante a Java Week8(A) Notepad (20)

Programa en java circulos
Programa en java circulosPrograma en java circulos
Programa en java circulos
 
662305 LAB12
662305 LAB12662305 LAB12
662305 LAB12
 
Please help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfPlease help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdf
 
Task Write a Java program to implement a simple graphics editor tha.pdf
Task Write a Java program to implement a simple graphics editor tha.pdfTask Write a Java program to implement a simple graphics editor tha.pdf
Task Write a Java program to implement a simple graphics editor tha.pdf
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfimport java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
 
Of class2
Of class2Of class2
Of class2
 
Introduccion del curso
Introduccion del cursoIntroduccion del curso
Introduccion del curso
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
Applications
ApplicationsApplications
Applications
 
Java awt
Java awtJava awt
Java awt
 
Sbaw091117
Sbaw091117Sbaw091117
Sbaw091117
 
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートIIopenFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
 
662305 11
662305 11662305 11
662305 11
 
Automated testing of mobile applications on multiple platforms
Automated testing of mobile applications on multiple platformsAutomated testing of mobile applications on multiple platforms
Automated testing of mobile applications on multiple platforms
 
Java-Events
Java-EventsJava-Events
Java-Events
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
Of class1
Of class1Of class1
Of class1
 
Awt
AwtAwt
Awt
 
Java practical
Java practicalJava practical
Java practical
 

Mais de Chaitanya Rajkumar Limmala (11)

Java Week3(A) Notepad
Java Week3(A)   NotepadJava Week3(A)   Notepad
Java Week3(A) Notepad
 
Java Week9(A) Notepad
Java Week9(A)   NotepadJava Week9(A)   Notepad
Java Week9(A) Notepad
 
Java Week7 Notepad
Java Week7   NotepadJava Week7   Notepad
Java Week7 Notepad
 
Java Week6(A) Notepad
Java Week6(A)   NotepadJava Week6(A)   Notepad
Java Week6(A) Notepad
 
Java Week4(A) Notepad
Java Week4(A)   NotepadJava Week4(A)   Notepad
Java Week4(A) Notepad
 
Java Week4(C) Notepad
Java Week4(C)   NotepadJava Week4(C)   Notepad
Java Week4(C) Notepad
 
Java Week1(B) Notepad
Java Week1(B)   NotepadJava Week1(B)   Notepad
Java Week1(B) Notepad
 
Java Week2(C) Notepad
Java Week2(C)   NotepadJava Week2(C)   Notepad
Java Week2(C) Notepad
 
Java Week2(B) Notepad
Java Week2(B)   NotepadJava Week2(B)   Notepad
Java Week2(B) Notepad
 
Java Week1(A) Notepad
Java Week1(A)   NotepadJava Week1(A)   Notepad
Java Week1(A) Notepad
 
Java Week2(A) Notepad
Java Week2(A)   NotepadJava Week2(A)   Notepad
Java Week2(A) Notepad
 

Último

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 

Último (20)

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 

Java Week8(A) Notepad

  • 1. JAVA WEEK8(A) /* Week 8 : a) Write a Java program for handling mouse events. */ import java.awt.*; import java.awt.event.*; import java.applet.Applet; /* < applet code="LabPro15" width=300 height=100> < /applet> */ public class LabPro15 extends Applet implements MouseListener { String msg="welcome";int x=100,y=100; public void init() { addMouseListener(this); } public void paint(Graphics g) { g.drawString(msg,x,y); } public void update(Graphics g) { paint(g); } public void mouseClicked(MouseEvent e) { } public void mousePressed(MouseEvent e) { msg="to";x=150;y=150; repaint(); } public void mouseReleased(MouseEvent e) { msg="gmrit";x=200;y=200; repaint(); } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } } Page 1