Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Applet Human face using applet programming

Have Programming Question? Ask it here!
 
 
 


Avishek Bhattacharyya
Human face using applet programming
1 Answer(s)      4 years and 6 months ago
Posted in : Applet


import java.applet.*;
import java.awt.*;

public class Chatterjee extends Applet
{
public void init()
{

}
public void paint(Graphics g)
{
g.drawOval(40,40,120,150);
g.drawOval(57,75,30,30);
g.drawOval(110,75,30,30);
g.fillOval(68,81,10,10);
g.fillOval(121,81,10,10);
g.drawLine(100,100,100,117);
g.fillRect(60,139,80,10);
}
}




In da above program,I would like to see the lips which is rectangle change to arc on clicking...or it should turn into smilimg face........How do I proceed using ActionListener..........pls explain....

Advertisement
View Answers

January 16, 2010 at 1:07 PM


Hi Friend,

Try the following code:

import java.awt.*;
import java.applet.*;

public class HumanFace extends Applet{
private int mouseX, mouseY;
private boolean mouseclicked = false;
public void init(){
}
public void paint(Graphics g){
g.drawOval(40,40,120,150);
g.drawOval(57,75,30,30);
g.drawOval(110,75,30,30);
g.fillOval(68,81,10,10);
g.fillOval(121,81,10,10);
g.drawLine(100,100,100,117);
g.fillRect(60,139,80,10);
if (mouseclicked) {
g.clearRect(60,139,80,10);
g.drawArc(70,100,60,60,0,-180);
mouseclicked = false;
}

}
public boolean mouseDown(Event e, int x, int y ) {
mouseX=x; mouseY=y;
mouseclicked = true;
repaint();
return true;
}
}

Thanks


Related Tutorials/Questions & Answers:
Human face using applet programming - Applet
Human face using applet programming  import java.applet.*; import java.awt.*; public class Chatterjee extends Applet { public void init... is rectangle change to arc on clicking...or it should turn into smilimg face
Human face using applet programming - Applet
Human face using applet programming  import java.awt.*; import java.applet.*; public class HumanFace extends Applet{ private int mouseX, mouseY... would like to know abut this error and its solution.I am using jdk1.3 I would
Advertisements
Create Human Face using Graphics
Create Human Face using Graphics In this section, you will learn how to create human face using Graphics. A Graphics provides contexts that allow...: import java.awt.*; import java.applet.*; public class HumanFace extends Applet
Programming using applets and oracle - Applet
Programming using applets and oracle  Develop an Online Examination software in java using applets as front end and oracle as back end. Software should handle at least ten users at a time. There are Multiple Choice questions
Programming with applet and oracle - Applet
Programming with applet and oracle  Develop an Online Examination software in java using applets as front end and oracle as back end. Software should handle at least ten users at a time. There are Multiple Choice questions
Java Programming - Applet
Java Programming  Write an applet that accepts a string as input and prints it in reverse order.  Hi Friend, Try the following code... Applet implements ActionListener { Label l1,l2,l3; TextField text; Button b
Web programming guidence - Applet
Web programming guidence  Dear Sir/Madam, I have studied (little) Java but not having good knowledge. I wish to host a simple web site. For which I am trying to make a web design. I could make simple web design
By using Applet display a circle in a rectangle
By using Applet display a circle in a rectangle  Write a java applet to display a circle in a rectangle
Write an applet to display scrolling image in an applet window using thread.
Write an applet to display scrolling image in an applet window using thread.  Write an applet to display scrolling image in an applet window using thread
How to convert a old face to young face, old face to young face
going to convert old face of the young face, you can also make it by using... How to convert a old face to young face   ...... Take an Image: First we have to open an old person picture to make young face
Create SpreadSheet same as excel using java applet
Create SpreadSheet same as excel using java applet  Hi Ji, May i know to create new excel sheet using java Applet
Create SpreadSheet same as excel using java applet
Create SpreadSheet same as excel using java applet  Hi Ji, May i know to create new excel sheet using java Applet
Play SWF file using Java - Applet
Play SWF file using Java  Hi I have task to design a screen saver using java. Now, I want to play .SWF (Flash file)in my Applet. Is there any way to play SWF from java class. Any reply will be appreciated. Thanks
How to change the face, change the face
How to change the face       You have a chance to learn how to change the face of the person to another face. It has very simple technique to make this effect
Java Programming using array
Java Programming using array  I'm creating a programming using array that will accept 10 letters and test if those letters are consonant...','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z'}; char ch
Applet
Applet  Write an applet to display a string in an applet. String should be passed as a parameter to an applet
Applet
Applet  Give the class hierarchy of an Applet class
applet
applet  Explain different stages in the lifecycle of an applet with figure.   Stages of Applet: Life cycle of an Applet: init(): This method is called to initialized an applet start(): This method is called after
Applet
Applet  how to run an applet on a web browser
applet
applet  What is the immediate superclass of the Applet class
Applet
Applet  Write a ava applet that sets blue color foreground and yellow color background at the start of an applet
java programming using RMI - RMI
java programming using RMI  Write a program using RMI to sell an item to the customer remotely and don't allow the customer to purchase the item if the stock is nil , by displaying an appropriate message
Applet
Applet  Explain the start() and stop() methods of applet life cycle.   Start and Start method of Applet Life Cycle Start () method: The start method of an applet is called after the initialization method init
Applet
Applet  I have a java applet that has a button. On clicking the button it should disappear and another applet should appear. How to write this code???? Also in login applet after successful login it should display admin applet
Applet
Applet  Write a short note on applet life cycle
Applet
Applet  Draw the class hierarchy of an Applet class. Also explain how to set background and forground colors in java
how to record qvga video using j2me - Applet
how to record qvga video using j2me  hello if it is possible how i can record qvga video usin j2me
applet
applet  what is applet in java   An applet is a small program that can be sent along with a Web page to a user. Java applets can perform... the following link: Applet Tutorials
how to record qvga video using j2me - Applet
how to record qvga video using j2me  hello if it is possible how i can record qvga video usin j2me?   Hi Friend, Please visit the following links: http://www.roseindia.net/j2me/video-midlet.shtml http
Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program that randomly fills in 0s and 1s into an n-by-n matrix,prints the matrix,and finds
Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program that randomly fills in 0s and 1s into an n-by-n matrix,prints the matrix,and finds
Applet
Applet  Write a Java applet that drwas a line between 2 points. The co-ordinates of 2 points should be passed as parametrs from html file. The color of the line should be red
How to make an angry face, make an angry face, angry face
How to make an angry face       We have this example to teach you a simple method to make an angry face... as I have done here. This an angry face. Look here
drawing a human in java - Java Beginners
drawing a human in java  i wanna to draw a human in java can u help me how can i draw.? the question is : how to draw a human in java add the nose + the eye + mouth .   where is the answer.? plz i want
applet
applet  applet to open new tab not working.here's my code import java.applet.*; import java.awt.*; import java.net.*; import java.awt.event.*; public class NewURL extends Applet implements ActionListener{ public void init
Could not able to run Java Applet in JSP using <jsp:plugin>
Could not able to run Java Applet in JSP using   I could not able to run the above example applet in the JSP. Getting class not found exception... the following links: http://www.roseindia.net/jsp/applet-jsp.shtml http
program to create student report using java applet,read the input using text boxesand generate the grades..?
program to create student report using java applet,read the input using text boxesand generate the grades..?   sir plz give me java applet codes for above question
What is Applet? - Applet
programming language, an applet is a small program that can be sent along with a Web...What is Applet?  What is Applet?  Hi,Here is a little information about Applet.An applet is a little application. Prior to the World Wide
applet - Applet
applet   how to draw textboxes using applets  Hi Friend...*; import java.awt.*; public class CreateTextBox extends Applet implements.../applet/ Thanks
how can i draw a table using applet or swings - Java Beginners
how can i draw a table using applet or swings  Hi RoseIndia, Actually, I was trying for creating a table using applet or swings.......... My task is create a table and enter the integer values during run time......I have
Java Applet - Creating First Applet Example
the applet. An applet is a program written in java programming language... Java Applet - Creating First Applet Example   ... an applet program. Java source of applet is then compiled into java class file and we
Using Applet in JSP
Using Applet in JSP     ... to include Applet in JSP page What is applet ? Applet is java program that can... such as mozila and internet explorer. Applet is designed to run remotely on the client
Applet : Java Glossary
; An applet in java programming language is a small program that only runs... to an applet that is embedded in a Web page using a special HTML tag. When a reader loads a Web page having an applet in it by using a Java-enabled browser, the browser
applet - Applet
.  Hi Friend, Try the following code: 1)Create an applet... extends Applet{ public void paint(Graphics g){ g.drawString("Welcome in Java Applet.",40,20); } } 2) Call this applet with html code
Applet - Applet
Applet  what is the concept of applet? what is different between the applet concept and HTML? what is mean by swing?  Hi friend, Applet Applet is java program that can be embedded into HTML pages. Java applets
Face recognition in java - Java Beginners
Face recognition in java  I have just started my software development project on the topic of face recognition system in java. However, I am new to this area and I even after browsing some articles on this topic I cannot get
Java Programming using Netbeans - IDE Questions
Java Programming using Netbeans  Hello Dear sir, i got one scenario where i have to pick the data of the student like id , name , class , age & address using netbeans jframe then i have to store these data into my package so
Drawing a Face v2
Java: Example - Drawing a Face v2 This simple application creates a graphic component to display a face. It subclasses JPanel and overrides...*; ////////////////////////////////////////////////////////////////// Face public class Face
Applet
of a parameter passed to an applet can be retrieved using getParameter() function. E.g.... Applet       Introduction Applet is java program that can be embedded into HTML pages. Java applets
Applet - Applet
Applet   Namaste, I want to create a Menu, the menu name is "Display... java.awt.event.*; public class menu2frame extends Applet implements WindowListener...------------------------"); g.drawString("Demo of Java Applet Window Event Program"); g.drawString("Java
 

 

 

DMCA.com