Smily face program in Applet and Say Hello When We Click on The Smily - FindersAdda : Tutorials of Make Money, Computer or Internet

Monday, 20 November 2017

Smily face program in Applet and Say Hello When We Click on The Smily

java program
Hello Friends! How are You? I hope, you will be good. Today, I am present once again with a new post. 

In this article, I am going to share a program in java Applet which display smily face and when we click on the smily then it shows a smily face and say "Hello !!" to the user.



In this program, we are extending Applet class to use Graphics class which is in Applet class and also implements MouseListener interface for using methods which is available in MouseListener interface.


There are five methods available in MouseListener interface.


  1. public abstract void mouseClicked(MouseEvent e)
  2. public abstract void mouseEntered(MouseEvent e)
  3. public abstract void mouseExited(MouseEvent e)
  4. public abstract void mousePressed(MouseEvent e)
  5. public abstract void mouseReleased(MouseEvent e)

If you implement MouseListener interface in class then you have to use all the methods of MouseListener interface.

In this program, we only needed one method but we have to use all methods of MouseListener Interface.


Let's see the program...







Compile and Run process

Before clicking the mouse
Before clicking the mouse

After clicking the mouse
After clicking the mouse



I hope you liked this post so much. If you loved this post, Then, share with your friends and also give some suggestion that what should i improve in this post. Thank You So Much...... 

About Author

SUMIT KUMAR GUPTA
SUMIT KUMAR GUPTA

Author & Editor

Myself Sumit Kumar Gupta & 21 year's old person. I am a programmer and blogger. I spend much more time on programming and blogging and helps other programmers and bloggers.

0 comments:

Post a Comment

We are eager to see your comments.
Comment Rule :

1. Don't use any link in the comment box. If you have any problem related to link then contact me with the contact form.

2. Don't use the wrong word if you write the wrong word in comment box then it will get spam.