Gadgets

Tuesday, 20 November 2012

Login form with css styles

LOGIN FORM WITH CSS STYLES :


CODE :  file name is login.html


<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <center>
        <div style="width: 400px;background-color: #c4dbe7;border:solid 3px blue;">
            <div style="background-color:  blue; font:10px; font-weight:  bold;color:  #c4dbe7;">LOGIN </div>
            <div style="margin: 30px;">
            <form action="servlet name" method="post">
                <table>
                    <tr><td>Email id :</td>
                        <td><input type="text" name="mailid" value="" /></td></tr>
                    <tr><td>Password :</td>
                        <td><input type="password" name="psw" value="" /></td></tr>
                    <tr><td></td><td><input type="submit" value="LOGIN" /></td>
                        </tr>
                        <tr><td></td><td><a href="">Create New Account</a></td></tr>
                        <tr><td></td><td><a href="">Forgot Password</a></td></tr>   
                </table>
            </form>
            </div>
           
        </div>
    </center>
    </body>
</html>




OUTPUT :





Thursday, 15 November 2012

Registration form using HTML with clear information


Registration form using HTML tags(<fieldset> and <legend>). This form is very clear


<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <!-- The fieldset element represents a set of form controls optionally grouped under a common name. -->
        <fieldset>
            <!-- The legend element represents a caption  -->
    <legend>Registration form</legend>
        <form action="servlet file name"method="post">
          
              
                <fieldset>
                  
                    <legend>Account Information</legend>
                    <table>
                        <tr>
                            <td>Email-Id :</td><td><input type="text"name="emailid"value=""/></td>
                        </tr>
                        <tr>
                            <td>Password :</td><td><input type="password"name="psw"value=""/></td>
                        </tr>
                        <tr>
                            <td>Reenter Password :</td><td><input type="password"name="repsw"value=""/></td>
                        </tr>
                      
                    </table>
            </fieldset>
                <fieldset>
                    <legend>Profile Information</legend>
                    <table>
                      
                        <tr>
                            <td>User Name :</td><td><input type="text"name="uname"value=""/></td>
                        </tr>
                        <tr>
                            <td>City :</td>
                            <td><select name="city">
                                    <option value="Hyderabad">Hyderabad</option>
                                    <option value="bangalore">Bangalore</option>
                                     <option value="delhi">Delhi</option>
                                      <option value="chennai">Chennai</option>
                                </select></td>
                        </tr>
                        <tr>
                            <td>Gender :</td><td><input type="radio" name="gender" value="male" />Male
                                <input type="radio" name="gender" value="female" />Female</td>
                        </tr>
                        <tr>
                            <td>Hobbies :</td><td><input type="checkbox" name="drinking" value="ON" />Drinking
                                <input type="checkbox" name="music" value="ON" />Listen Music
                                <input type="checkbox" name="games" value="ON" />Playing Games
                                <input type="checkbox" name="drawing" value="ON" />Drawing
                                <input type="checkbox" name="other" value="ON" />Other</td>
                        </tr>
                        <tr>
                            <td>Select Photo :</td><td><input type="file" name="photo" value="" /></td>
                        </tr>
                        <tr><td><input type="submit" value="Signup" /></td></tr>
                    </table>
            </fieldset>
              
          
        </form>
    </fieldset>
    </body>
</html>

OUTPUT :




Thursday, 18 October 2012

simple java program enter the values using keyboard

SIMPLE JAVA PROGRAM ENTER THE VALUES USING  KEYBOARD

import java.io.*;
import java.lang.*;
public class Keybord {
    public static void main(String a[]) throws IOException
                               {
      BufferedReader br=new BufferedReader( new InputStreamReader(System.in));     
      System.out.println("Enter Name : ");
      String n=br.readLine();    
      System.out.println("Enter 5 Subjects Marks : ");
      int i=Integer.parseInt(br.readLine());
      int j=Integer.parseInt(br.readLine());
      int k=Integer.parseInt(br.readLine());
      int l=Integer.parseInt(br.readLine());
      int m=Integer.parseInt(br.readLine());
      int g=i+j+k+l+m;     
      System.out.println("Enter P/F(P:pass/F:faile): ");
      char r=(char)br.read();     
     System.out.println("Name : "+n);
     System.out.println("Total Marks :"+g);
     System.out.println("Result P/F(P:pass/F:faile): "+r);           
    }   
}
OUTPUT
Enter Name :
narendar
Enter 5 Subjects Marks :
50
60
90
80
95
Enter P/F(P:pass/F:faile):
p
Name : narendar
Total Marks :375
Result P/F(P:pass/F:faile): p

Monday, 15 October 2012

laugh icon using threads

LAUGH SYMBOL


import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.lang.*;

public class Example {
   
 public static void main(String a[])
   {
     Ex i=new Ex(); 
   }
}
class Ex extends Frame implements Runnable//runnable is an inteface we crate threads using thread class and Runnable interface
{
    
    Thread t;//thread is a class
    Ex()
    {
        this.setBackground(Color.red);//background color for frame
      this.setTitle("smile icon");//title
      this.setSize(600,600);//size of the frame(x,y)
      this.setVisible(true);//frame visibility  is true
      t=new Thread(this);//thread is a class
      t.start();//start() method is used for start the thread
     
    }
    public void paint(Graphics g)//pain is a method. it is used for draw the images and text
    {
        g.setColor(Color.yellow);//set color for smile icon oval
        g.fillOval(50,50,50,50);//smile icon oval size(x,y,width,height)
        g.setColor(Color.white);//set color for eyes
         g.fillOval(60,64,10,10);//eye size(x,y,width,height)
        g.fillOval(80,64,10,10);// " "
        g.setColor(Color.black);//set color for smile icon eye
        g.fillOval(63,66,4,4);//eye size(x,y,width,height)
        g.fillOval(83,66,4,4);// " "
       
       g.setColor(Color.white);//set color for smile icon laugh
        g.fillOval(63,76,20,10);//eye size(x+width,y+height,width,height)
        g.setColor(Color.red);
        g.drawOval(63,76,20,10);
            
    }
     public void run()//run() is a method to run thread
        {
      
        }
}


OUTPUT




smile symbol using threads

SMILE SYMBOL  

import java.awt.*;
import java.lang.*;

public class SmileIcon {
   public static void main(String a[])
   {
     MySmile i=new MySmile(); 
   }
}
class MySmile extends Frame implements Runnable//runnable is an inteface we crate threads using thread class and Runnable interface
{
   
    Thread t;//thread is a class
    MySmile()
    {
        this.setBackground(Color.red);//background color for frame
      this.setTitle("smile icon");//title
      this.setSize(600,600);//size of the frame(x,y)
      this.setVisible(true);//frame visibility  is true
      t=new Thread(this);//thread is a class
      t.start();//start() method is used for start the thread
     
    }
    public void paint(Graphics g)//pain is a method. it is used for draw the images and text
    {
        g.setColor(Color.yellow);//set color for smile icon oval
        g.fillOval(50,50,50,50);//smile icon oval size(x,y,width,height)
        g.setColor(Color.white);//set color for eyes
         g.fillOval(60,64,10,10);//eye size(x,y,width,height)
        g.fillOval(80,64,10,10);// " "
        g.setColor(Color.black);//set color for smile icon eye and arc
        g.fillOval(63,66,4,4);//eye size(x,y,width,height)
        g.fillOval(83,66,4,4);// " "
       
         g.setColor(Color.red);
        g.drawArc(60,55,30,30,-65,-65);//arc size(x+width,y+height,width,height,start angle,arc angle)
     
    }
     public void run()//run() is a method to run thread
        {
       
        }
}

OUTPUT