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....
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 - AppletHuman 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 - AppletHuman 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 GraphicsCreate
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 - AppletProgramming 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 - AppletProgramming 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 - AppletJava 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 - AppletWeb
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
Java Programming using arrayJava
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
Play SWF file using Java - AppletPlay 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
java programming using RMI - RMIjava
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
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
face detection and face recognition face detection and
face recognition hi,i will create a project detection and recognition of
face in java , i create the
face detection
using opne-cv but i can't create the
face reconition can you help me please thanks
i
AppletApplet Write an
applet to display a string in an
applet. String should be passed as a parameter to an
applet how to record qvga video using j2me - Applethow 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
appletapplet What is the immediate superclass of the
Applet class
AppletApplet how to run an
applet on a web browser
appletapplet 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
AppletApplet Give the class hierarchy of an
Applet class
AppletApplet Write a ava
applet that sets blue color foreground and yellow color background at the start of an
applet AppletApplet 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
AppletApplet Write a short note on
applet life cycle
AppletApplet 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 AppletApplet Draw the class hierarchy of an
Applet class. Also explain how to set background and forground colors in java
Java Programming using Netbeans - IDE QuestionsJava
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
appletapplet 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
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
AppletApplet 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
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
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
appletapplet
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
Java using Netbeans Object Oriented Programming Java
using Netbeans Object Oriented
Programming I am trying to make a program that uses a main class and a separate class with one public method and one private method. The main method in the main class asks the user for 2
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 - Appletapplet
how to draw textboxes
using applets Hi Friend...*;
import java.awt.*;
public class CreateTextBox extends
Applet implements.../
applet/
Thanks
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 - AppletApplet 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
Applet the
applet. An
applet is a program written in java
programming language...
to an
applet can be retrieved
using getParameter() function. E.g. code:ADS...
Applet
Applet - AppletApplet 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
applet questionapplet question sir please tell me that
how can i call an event on clicking on
applet window
without
using any component