Movement of cursor by programing

Hi friends😎,
I want to write a program that controls the cursor movements.I want to do it java.
For this fist i want to know how the thing goes in movement of cursor and some thing about how the working of mouse be😕
Can any one give me some help where i can get the information i specified😒
and your ideas too.

Replies

  • dipen30
    dipen30
    read here it will helpful to you

    #-Link-Snipped-#
  • sookie
    sookie
    Hi Raviteja,

    First I would say go through once the link shared by Dipen. It will show you which class or interface is responsible for what kind of mouse events. Also it will show you what kind of method you need to implement at what event.

    To start with- how to go ahead with it.

    Step 1: Write a simple class that extends applet and implements appropriate Listener(for instance MouseListener)
    Step 2: In the init() method of the applet, add the listener(For this you need to read bit about Event Handling in Java)
    Step 3: As in Step 1, you would have already implemented a Listener interface using "implements" then you also need to implement the method provided by Listener interface and need to write your coding stuff in it. For e.g if you are using MouseListener interface , you can implement any of the following methods depending on your requirements.(For more details about Listeners and their methods - Dipen's link)
    public void mousePressed(MouseEvent e) {}
    public void mouseReleased(MouseEvent e) {}
    public void mouseClicked(MouseEvent e) {}
    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) {}
    Step 4: Run the applet and play with the events and your code.

    Hope could be of some use. If any queries, fire them. We can try to write a wonderful code over here also. Give a try once. 😀

    Thanks !

You are reading an archived discussion.

Related Posts

In Assembly Language Programing , if we use a stack then we have to allocate some memory for the stack.Now , my question is if we give the space from...
I'm posing this question in order to overcome my confusion and get some clarity. I wanna know what's the difference between the following words. 1.Unary operator and Binary operator 2.Relation...
can any one give me a brief explanation about piping. What is piping? For what purpose it is used? and the sites which can give me some help.......
Guys , Google is conducting coding competetion. Check this link for more details... Google Code Jam 2009 PS..If this is invalid please delete it 😀
Hi All, I'm currently involved in a project related to solar energy. Its a project to light up village streets using solar energy. We are just at the start up...