Which Anti Virus

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 1 September 2013

Lock Your Folder Without Any Software

Posted on 08:27 by Unknown
How To Lock Folder ?

1. Open Notepad and Copy code given below into it.

cls
@ECHO OFF
title coolhacking-tricks.blogspot.com
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST MyFolder goto MDMyFolder
:CONFIRM
echo Are you sure to lock this folder? (Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren MyFolder "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock Your Secure Folder
set/p "pass=>"
if NOT %pass%== killer goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" MyFolder
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDMyFolder
md MyFolder
echo MyFolder created successfully
goto End
:End


2. Save the notepad file as lock.bat (.bat is must)
3. Now double click on lock.bat and a new folder will be created with name MyFolder
4. Copy all your data you want to protect in that New folder
5. Now double click on lock.bat and when command promp appears Type Y and press enter.
6. Now MyFolder will be hidden from you view, to access that folde double click on lock.bat
7. It will ask for password enter your password and done. (Default password is killer)
Read More
Posted in general | No comments

Java Swing Look and Feel Feature-Example-Set Motif,Metal and Windows Look and Feel

Posted on 03:04 by Unknown
Write a following code in netbeans IDE 7.1 and save file as RegistrationForm.java and run it and you can able to set your look and feel in your application.  


package registrationform;

/**
 *
 * @author NISH
 */
import java.awt.Container;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;

public class RegistrationForm extends JFrame implements ItemListener,ActionListener{
    JLabel title,lookfeel;
    JLabel l[]=new JLabel[7];
    JTextField t[]=new JTextField[7];
    JPasswordField tp;
    String lbl[]=new String[7];
    Container c;
    JComboBox cb;
    JRadioButton male,female;
    JOptionPane jop;
    ButtonGroup grp;
    JButton breg,bcncl;
    int vsp=80,hsp=100;
    int spx,spy;
    public RegistrationForm()
    {
        lbl[0]="Name :"; lbl[1]="Address :"; lbl[2]="Gender :"; lbl[3]="Email :"; lbl[4]="Phno :"; lbl[5]="Uname :"; lbl[6]="Password :";
        c=this.getContentPane();
        setLayout(null);
        lookfeel=new JLabel("Select LookAndFill :");
        lookfeel.setBounds(5, 5, 120, 20);
        c.add(lookfeel);
        cb=new JComboBox();
        cb.setBounds(125, 5, 75, 20);
        cb.addItem("Metal");
        cb.addItem("Motif");
        cb.addItem("Window");
        c.add(cb);
        title=new JLabel("Registration");
        title.setFont(new Font("Times New Roman", NORMAL, 20));
        title.setBounds(170, 30, 120,90);
        c.add(title);
       
        spy=30;
        spx=100;
        for(int i=0;i<=6;i++)
        {
            l[i]=new JLabel(lbl[i]);
            l[i].setBounds(vsp,hsp , 80, 40);
            hsp=hsp + spy;
            c.add(l[i]);
        }
        male=new JRadioButton("Male");
        female=new JRadioButton("Female");
        vsp=80;
        vsp=vsp+spx;
        hsp=110;
        for(int i=0;i<=6;i++)
        {
            t[i]=new JTextField("");
            if(i==2)
            {
                    male.setBounds(vsp,hsp, 60, 20);
                    c.add(male);
                    female.setBounds(vsp + 70,hsp, 100, 20);
                    c.add(female);
                    male.setSelected(true);
                    grp=new ButtonGroup();
                    grp.add(male);
                    grp.add(female);
            }
            else if(i==6)
            {
                tp=new JPasswordField();
                tp.setBounds(vsp, hsp, 170, 20);
                c.add(tp);
            }
            else
            {
                t[i].setBounds(vsp,hsp , 170, 20);
                c.add(t[i]);
            }
            hsp=hsp + spy;
        }
        breg=new JButton("Submit");
        breg.setBounds(110, hsp+spy, 90, 30);
        c.add(breg);
       
        bcncl=new JButton("Cancel");
        bcncl.setBounds(220, hsp+spy, 90, 30);
        c.add(bcncl);
        cb.addItemListener(this);
        breg.addActionListener(this);
        bcncl.addActionListener(this);
    }
    public static void main(String[] args) {
        RegistrationForm rg=new RegistrationForm();
        rg.setTitle("Registration Form");
        rg.setSize(450, 500);
        rg.setResizable(false);
        rg.show();
    }
    @Override
    public void itemStateChanged(ItemEvent e) {
        try {
            if(cb.getSelectedItem().toString() == "Metal")
            {
                UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
            }
            if(cb.getSelectedItem().toString() == "Motif")
            {
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
            }
            if(cb.getSelectedItem().toString() == "Window")
            {              UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            }
            SwingUtilities.updateComponentTreeUI(c);
        }
        catch(Exception ex)
        {
        }
    }
    @Override
    public void actionPerformed(ActionEvent e) {
        jop=new JOptionPane();
        String str="";
        if(e.getSource().equals(breg))
        {
                for(int i=0;i<=6;i++)
                {
                    if(i==2)
                    {
                        if(male.isSelected())
                        {
                            str= str + lbl[i] + " " + "Male" + "\n";
                        }
                        else
                        {
                            str= str + lbl[i] + " " + "FeMale" + "\n";
                        }
                    }
                    else if(i==6)
                    {
                        str= str + lbl[i] + " " + tp.getText().toString() + "\n";
                    }
                    else
                    {  
                        str= str + lbl[i] + " " + t[i].getText().toString() + "\n";
                      
                    } 
                } 
               jop.showMessageDialog(c,str,null, JOptionPane.INFORMATION_MESSAGE);
        }
        for(int i=0;i<=6;i++)
        {
            t[i].setText("");
        }
        tp.setText("");
        if(e.getSource().equals(bcncl))
        {
            for(int i=0;i<=6;i++)
            {
                t[i].setText("");
            }
            tp.setText("");
        }
    }
}

Output:-

Read More
Posted in java | No comments

Make Analog Clock using java

Posted on 03:00 by Unknown
write a following code in netbeans IDE 7.1 and save file as Analogclock.java and run it and you will have your own Analog Clock... 

package analogclock;

/**
 *
 * @author NISH
 */
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.util.Calendar;

/*
 <applet code="Clck" width=1500 height=3000>
 </applet>
 */
public class Analogclock extends Applet implements Runnable
{
    private static final double TWO_PI   = 2.0 * Math.PI;
    private Calendar nw = Calendar.getInstance();
    int width=300,hight=300;
    int xcent= width / 2,ycent= hight / 2;
    int minhand,maxhand;
    double rdns;
    int dxmin,dymin,dxmax,dymax;
    double radins,sine,cosine;
    double fminutes;
    Thread t=null;
    Boolean stopFlag;
  
    public void start()
    {
       t=new Thread(this);
       stopFlag = false;
       t.start();
    }
    public void run()
    {
       for( ; ; )
       {
              try {
                     updateTime();
                     repaint();
                     Thread.sleep(100);
                     if(stopFlag)
                        break;
                   }
              catch(InterruptedException e) {}
       }
    }
    public void stop()
    {
        stopFlag=true;
        t=null;
    }
    private void updateTime() {
       
        nw.setTimeInMillis(System.currentTimeMillis());
    }
    public void paint(Graphics g)
    {
        int hours   = nw.get(Calendar.HOUR);
        int minutes = nw.get(Calendar.MINUTE);
        int seconds = nw.get(Calendar.SECOND);
        int millis  = nw.get(Calendar.MILLISECOND);
        minhand=width /8;
        maxhand=width /2;
        rdns= (seconds + ((double)millis/1000)) / 60.0;
        drw(g,rdns,0,maxhand);
        g.drawString(hours + ":" + minutes + ":" + seconds,  minhand+90, maxhand+60);
        minhand = 0;                    // Minute hand starts in middle.
        maxhand = width / 3;
        fminutes = (minutes + rdns) / 60.0;
        drw(g, fminutes, 0, maxhand);
       minhand = 0;                    // Minute hand starts in middle.
        maxhand = width / 4;
        drw(g, (hours + fminutes) / 12.0, 0, maxhand);
        g.drawOval(0,0, width, hight);
        g.drawString("9", xcent-145, ycent -0);
        g.drawString("3", xcent+140, ycent -0);
        g.drawString("6",xcent , ycent+145);
        g.drawString("12",xcent , ycent-135);
     }
   
    public void drw(Graphics g,double prct,int minRadius, int maxRadius) 
    {
        radins= (0.5 - prct)* TWO_PI;
        sine   = Math.sin(radins);
        cosine = Math.cos(radins);
        dxmin = xcent + (int)(minRadius * sine);
        dymin = ycent + (int)(minRadius * cosine);
       
        dxmax = xcent + (int)(maxRadius * sine);
        dymax = ycent + (int)(maxRadius * cosine);
      
        g.drawLine(dxmin, dymin, dxmax, dymax);
    }
   

}

output:-

Read More
Posted in java | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

Categories

  • Android
  • Android Apps
  • apps
  • BlackBerry
  • Cprog
  • dfd
  • erd
  • Facebook
  • general
  • Hacking
  • HTC
  • ios
  • java
  • Mobile
  • nokia
  • Samsung
  • Srs
  • Window Apps
  • Windows 8

Blog Archive

  • ▼  2013 (91)
    • ▼  November (6)
      • GTU Paper Solution and Material as Per GTU syllabus
      • Different Operating System and Their RAM Support
      • Free Download E-DRAW MAX
      • Play HIGH GRAPHIC GAMES like-GTA on your PC withou...
      • C Program Library files(Header Files)
      • Features Of Android KitKat
    • ►  October (5)
    • ►  September (17)
    • ►  August (3)
    • ►  July (8)
    • ►  June (13)
    • ►  May (12)
    • ►  April (27)
Powered by Blogger.

About Me

Unknown
View my complete profile