Manu

Saturday, November 19, 2016

Develop and applet that receive one string and display in reverse fashion

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class revst extends Applet implements MouseMotionListener
{
            TextField t,t1;
            public void init()
            {
                        t=new TextField(25);
                        add(t);
                        t1=new TextField(25);
                        add(t1);
                        t1.addMouseMotionListener(this);
            }
            public void mouseMoved(MouseEvent m) {
                        StringBuffer st=new StringBuffer(t.getText());
                        st.reverse();
                        t1.setText(""+st);
            }
            public void mouseDragged(MouseEvent m){}
}

Output :


2 comments:

  1. I feel happy to find your post, excellent way of writing and also I would like to share with my colleagues so that they also get the opportunity to read such an informative blog.
    java certification training in chennai
    struts training in chennai

    ReplyDelete
  2. I am getting a warning (applet) tag requires height attribute.and code attribute.

    ReplyDelete