Go to Top
Showing posts with label Print. Show all posts
Showing posts with label Print. Show all posts

Tuesday, 1 November 2011

Utilities 19 : How to print in style with Java

Here's a nice program to print anything you want in style. Help yourself to the surprise.

Java Program :

import java.io.*;
import java.util.Random;
class visual
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   static String s="",s1,a1="";
    static Random r=new Random();
 static void main()throws IOException
 {
     matrix("Welcome to the matrix");
     sleep(1000);
     input();
    }
    static void input()throws IOException
    {
        matrix("Enter any string : ");
        s=br.readLine();
        matrix(s);
    }
    static void matrix(String a)
    {
        int c,i,c1;
        for(c1=0;c1<a.length();c1++)
        {
            for(i=0;i<3;i++)
            {
            c=r.nextInt(123);
            if((c>=48 && c<=57) || (c>=65 && c<=90) || (c>=97 && c<=122))
            {
                System.out.print("\f"+a1+(char)c);
                sleep(70);
            }
            else{
                i=i-1;
               continue;
            }
        }
            a1=a1+a.charAt(c1);
            System.out.print("\f"+a1);
        }
        a1=a1+"\n\n";
 }
 static void sleep(int c)
 {
     try{Thread.sleep(c);}
     catch(Exception e){}
    }
}

Also, I am working on a new school project, to make a Telephone Billing System, and would be posting it soon after my project is over.

ShareThis