Remove File Protection Using java

In this video i'm going teach you how to remove file protection using java.
i use java io package for this lesson .
you can download netbeans project from here

 you can download flv video from here

code:   private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                       
              try {
            File file=new File(jTextField1.getText());
            if (file.canWrite()) {
                jLabel2.setText("This File Is Writeble");

 jLabel2.setText("This File Is read Onley");
        } catch (Exception e) {
        }    }       

How to make file Write Protected

In this lesson,i hope to teach you how to make file write protected using this lesson i use Java IO package.
first i get input using j text field and
pass it value to j button
you can download net beans project
from here

you can download youtube video from here
Code :private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        try {
            File file=new File(jTextField1.getText());
            if (file.canWrite()) {
                jLabel2.setText("This File Is Writeable");
 jLabel2.setText("This File Is Read Onley");
 }        } catch (Exception e) {
        }    }                            

How To Zip File Using Java

hi frends im sameera here .to day im going to teach you how to zip file using can modify code as you wish .

download Video

download netbeans project

watch on youtube

thanks for comming :)
take care !
bye !

hmm here is the code
 * Created on Aug 20, 2011, 4:49:48 PM
package howtozip;
import javax.swing.JOptionPane;
 * @author Sameera
public class zipit extends javax.swing.JFrame {
    /** Creates new form zipit */
    public zipit() {
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jLabel1.setText("input path");
       jLabel2.setText("output path");
        jTextField1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jTextField2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jButton1.setText("ZIP IT");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(54, 54, 54)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE))
                .addContainerGap(43, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(175, Short.MAX_VALUE)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(56, 56, 56))
                .addGap(46, 46, 46)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(54, 54, 54)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(31, 31, 31))
    }// </editor-fold>                        
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        try {
            byte []buffer=new byte[1024];
            FileOutputStream fos=new FileOutputStream(jTextField2.getText());
            ZipOutputStream zos=new ZipOutputStream(fos);
            ZipEntry ze=new ZipEntry(jTextField1.getText());
            FileInputStream in=new FileInputStream(jTextField1.getText());
            int len;
            while ((>0) {
            JOptionPane.showMessageDialog(null,"file was zipped");
        } catch (Exception e) {
    * @param args the command line arguments
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new zipit().setVisible(true);
    // Variables declaration - do not modify                     
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    // End of variables declaration                   


Write Data To File

this video shows how to write data to a file.using java io package.hmmm
have fun.
see you in next tutorial.
thanks for comming!
take care !
bye ! 
Download video

download Netbeans project
watch on youtube

Create File using java

This lesson we are going to make file using java IO package .IO mean input out put .watch and have fun.and also you can download netbeans project that i have done :

Download Video

Download Netbeans Project

watch On youtube

Find Disk Space Using Java

This lesson shows how to calculate Disk Total size and free space and useable space using java. watch and have fun :)
thanks for comming 
bye take care !
you can download netbeans project that i have created .
1.Download Video on youtube

3.Download Netbeans Project


Play mp3 Using   Jlayer

Hello Friends im sameera im going to teach about how to play mp3 using is pretty dont wonna worry,i teach every step :) ok
before we start our lesson we need to find some mp3 and download jlayer
you can just google as jlayer download
or i ll give download link hmm,i ll give the download link below.its easy nothing to serf :D
our porpose is when we paly main class it linked with another java form,we put jlable to jframe and it shows some word like "Mp3 is playing".it is additional step if u dont like it so don't do it :)
i use Do while loop for this becorse,if their isnt a loop the mp3 is play only one time,but we apply loop so it works till the condition goes  false.
here is the way to write do while loop.dont worry i teach some lessons about loops :)
this is for additional knowledge
do{ statement to do you wanna do     }
( condition true);

and also i use try catch in here because it prevent the exceptions and handle it.
i apply do while loop and try catch as this
 int i=0;
          try {
              FileInputStream file=new FileInputStream("C:\\Documents and Settings\\Sameera\\Desktop\\bl.mp3");
              Player playmp3=new Player(file);
          } catch (Exception e) {
 }while(i<10);and full code in main class is like this:
package java2zmp3;
import javazoom.jl.player.Player;
public class Main {   
     public static void main(String[] args) {    
  new Welcome().setVisible(true);  
    int i=0;    
       try {       
       FileInputStream file=new FileInputStream("C:\\Documents and Settings\\Sameera\\Desktop\\bl.mp3");     
         Player playmp3=new Player(file);     ;        
catch (Exception e) {          }  
watch the video and have fun don't forget to say thank thanks.

Download jlayer

watch on youtube

 download this video
Download Netbens Project
Hint :
i genarate some codings by typing few letters and press ctrl+space :)