Popular Articles

India is home to great literature and two of the greatest epics originated from the sub-continent. They are the Ramayana and the Mahabharata. The Mahabharata
Gift buying is something most people just swear by. Of all things it counts up to make a gift count, it can become a nightmare for some to zero in on the
As per science, the universe was born with the Big Bang. Religions argue that everything was created by an almighty God. Amidst the scientific theories

Latest Articles

Gift buying is something most people just swear by. Of all things it counts up to make a gift count, it can become a nightmare for some to zero in on the
India is home to great literature and two of the greatest epics originated from the sub-continent. They are the Ramayana and the Mahabharata. The Mahabharata
As per science, the universe was born with the Big Bang. Religions argue that everything was created by an almighty God. Amidst the scientific theories

import java.awt.*;

import java.awt.event.*;

import java.applet.*;

/*

*/

public class AdapterDemo extends Applet

{

        public void init()

        {

                addMouseListener(new MyMouseAdapter(this));

                addMouseMotionListener(new MyMouseMotionAdapter(this));

        }

}

class MyMouseAdapter extends MouseAdapter

{

        AdapterDemo adapterDemo;

        public MyMouseAdapter(AdapterDemo adapterDemo)

        {

                this.adapterDemo = adapterDemo;

        }

        public void mouseClicked(MouseEvent me)

        {

                adapterDemo.showStatus("Mouse Clicked");

        }

}

class MyMouseMotionAdapter extends MouseMotionAdapter

{

        AdapterDemo adapterDemo;

        public MyMouseMotionAdapter(AdapterDemo adapterDemo)

        {

                this.adapterDemo = adapterDemo;

        }

        public void mouseDragged(MouseEvent me)

        {

                adapterDemo.showStatus("Mouse dragged");

        }

}

  • No comments found