L Mouse Events Java source code
#1

Code:
/*                      Mouse Events            */                
import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class LMouseEvents extends Applet
                  implements MouseListener,MouseMotionListener
{                                            
        String msg=" ";
        int mousex = 0,mousey = 0;
    public void init()
    {
        setBackground(Color.cyan);
                addMouseListener(this);
                addMouseMotionListener(this);
    }
        public void mouseClicked(MouseEvent me)  
    {
                mousex = me.getX();
                mousey = me.getY();
                msg = "Mouse Clicked";
        setBackground(Color.green);
        repaint();
    }

    public void mouseEntered(MouseEvent me)
    {
                mousex = me.getX();
                mousey = me.getY();
                msg="MouseEntered";
        setBackground(Color.red);
        repaint();
    }

    public void mouseExited(MouseEvent me)
    {
                mousex = me.getX();
                mousey = me.getY();
                msg="Mouse Exited";
        setBackground(Color.black);
        repaint();
    }

    public void mousePressed(MouseEvent me)
    {
        mousex=me.getX();
        mousey=me.getY();
        msg="Down";
        setBackground(Color.pink);
        repaint();
    }

    public void mouseReleased(MouseEvent me)
    {
                mousex = me.getX();
                mousey = me.getY();
                msg = "up";
        setBackground(Color.magenta);
        repaint();
    }
    public void mouseDragged(MouseEvent me)
    {
                mousex = me.getX();
                mousey = me.getY();
                msg = "Ravi Krishna.M";
        setBackground(Color.lightGray);
        repaint();
    }
    public void mouseMoved(MouseEvent me)
        {
        setBackground(Color.orange);
        showStatus("Moving mouse at"+me.getX()+","+me.getY());
    }
    public void paint(Graphics g)
    {
        g.setColor(Color.blue);
        g.drawString(msg,mousex,mousey);
    }
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: cnn student current events, source code for mouse event in java, anchoring script for office events, recent risk management events in, advanced mouse pointer control using gestures matlab code, power quality events, mba management meet events,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Simple Key Events Java source code smart paper boy 3 3,603 07-02-2017, 03:41 PM
Last Post: NARESHLAFOOT
  Window Events Java source code smart paper boy 1 3,675 02-03-2012, 10:48 AM
Last Post: seminar paper
  Inter net banking java source code smart paper boy 3 5,953 01-03-2012, 11:24 AM
Last Post: seminar paper
  UDP server java source code smart paper boy 1 3,814 05-01-2012, 05:50 PM
Last Post: jeslinapeter
  UDP client Java source code smart paper boy 2 3,679 12-12-2011, 09:56 AM
Last Post: seminar addict
  Text Demo Java source code smart paper boy 0 2,076 30-08-2011, 12:44 PM
Last Post: smart paper boy
  Text Area Demo Java source code smart paper boy 0 2,083 30-08-2011, 12:44 PM
Last Post: smart paper boy
  Servlet Database Java source code smart paper boy 0 2,458 30-08-2011, 12:42 PM
Last Post: smart paper boy
  server test Java source code smart paper boy 0 2,266 30-08-2011, 12:42 PM
Last Post: smart paper boy
  Ser To App java source code smart paper boy 0 1,680 30-08-2011, 12:39 PM
Last Post: smart paper boy

Forum Jump: