Sunday, 30 November 2014

Caesar Applet Demo in Java

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class CaesarApplet extends Applet implements ActionListener
    Label enterText;
    TextField text;

    Label enterKey;
    TextField key;

    Button encrypt;
    Button decrypt;

    Label result_text;
    Label result;

    public void init()
            enterText = new Label("Enter Text: ");
            text = new TextField(25);
            enterKey = new Label("Enter key: ");
            key = new TextField(25);
            encrypt = new Button("Encrypt Text");
            decrypt = new Button("Decrypt Text");
            result_text = new Label("Resultant Text: ");
            result = new Label();




    public void actionPerformed(ActionEvent ae)
        if(ae.getSource() == encrypt)
            String pt = text.getText();
            String k = key.getText();
            int encrypt_key = Integer.parseInt(k);

            String res = encrypt(pt,encrypt_key);
        else if(ae.getSource() == decrypt)
            String ct = text.getText();
            String k = key.getText();
            int decrypt_key = Integer.parseInt(k);

            String res = decrypt(ct,decrypt_key);

    static public String encrypt(String pt,int encrypt_key)
        char c;
        int num,i;

        StringBuffer sb = new StringBuffer(pt);
        int len = sb.length();




  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.

    1. Great Article android based projects

      Java Training in Chennai

      Project Center in Chennai

      Java Training in Chennai

      projects for cse

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
    Advanced AWS Training in Bangalore | Best Amazon Web Services Training Institute in Bangalore
    Advanced AWS Training Institute in Pune | Best Amazon Web Services Training Institute in Pune
    Advanced AWS Online Training Institute in india | Best Online AWS Certification Course in india
    AWS training in bangalore | Best aws training in bangalore

  3. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's. 
    microsoft azure training in bangalore
    rpa training in bangalore
    best rpa training in bangalore
    rpa online training

  4. Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
    Best Devops online Training
    Online DevOps Certification Course - Gangboard