Wednesday, July 1, 2009

How to make 1000s of Directories in one second

How abt making a lots of directories using java pgm ??

Heres the complete JAVA GUI(Graphical User Interface) ,

programs source code to do that.

Just copy the below code and save it as
Gui.java
. the name should be Gui.java

/***********************************************************************************

************************************************************************************


This code is free to distribute.

@Author : Akhildas k k

email :- iam_kingston@iamcrazy.in

visit:- http://iam-the-hero.over-blog.com


************************************************************************************

************************************************************************************/

import java.awt.event.*;

import javax.swing.*;

import java.io.*;

public class Gui extends JPanel implements ActionListener {

JPanel p1;

JButton b1;

JTextField t1,t2;

JFrame frame;

JLabel l1,l2;

String s,s1;

int n;

public static void main(String arg[]) {

Gui st = new Gui();

st.go();

}

public void go() {

p1 = new JPanel();

l1 = new JLabel("Enter Folder Name and number of folders");

t1 = new JTextField(15);

t2 = new JTextField(5);

b1 = new JButton("Create");

frame = new JFrame("Powered by Akhildas™ ");

frame.getContentPane().add(p1);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

p1.add(l1);

p1.add(t1);

p1.add(t2);

p1.add(b1);

b1.addActionListener(this);

frame.setSize(280,109);

frame.setVisible(true);

}

public void actionPerformed(ActionEvent event) {

s = t1.getText();

s1 = t2.getText();

n = Integer.parseInt(s1);

for(int i=0;i<n;i++){

File dir = new File(s+i);

dir.mkdir(); }

JOptionPane.showMessageDialog(this,"Folders Created Sucessfully !",

"iam_kingston@iamcrazy.in",JOptionPane.INFORMATION_MESSAGE);

t1.setText("");

t2.setText("");

}

}

/* Downloaded from http://iam-the-hero.over-blog.com


Powered by Akhildas™ */


Note : to run JAVA programs u need to install
Java
in ur system.

Then compile the above code and run……enjoy !!!

0 comments:

Followers

The Daily Puppy

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | JCPenney Coupons