CrazyEngineers
  • 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
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • dipen30

    MemberAug 20, 2009

    read here it will helpful to you

    #-Link-Snipped-#
    Are you sure? This action cannot be undone.
    Cancel
  • sookie

    MemberAug 20, 2009

    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 !
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register