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

We are one community

Boddunan.com is a community driven articles and knowledge sharing portal. Members can share their knowledge with other members and visitors of the website and make them-self popular in the massive Internet world.

Boddunan.com is used not only as a platform to share the content and knowledge, but also a useful tool to learn from the vast amount of knowledge shared by thousands of registered users of the website. The content directory is a host of all the articles posted by the community and is available for the visitors of boddunan.com to read and learn from the extensive knowledge,