Select all JCheckBox in one click

Watch video below :


*********************************************************************
COMPLETE SOURCE CODE FOR : JCheckBoxMultipleSelectInOneClick.java
*********************************************************************

import javax.swing.JCheckBox;
import javax.swing.JFrame;

import java.awt.GridLayout;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class JCheckBoxMultipleSelectInOneClick extends JFrame implements ActionListener
{
 //Create JCheckBox object
 JCheckBox a=new JCheckBox("Select All");
 JCheckBox b=new JCheckBox("Car");
 JCheckBox c=new JCheckBox("Lorry");
 JCheckBox d=new JCheckBox("Motorcycle");
 
 //Constructor for JCheckBoxMultipleSelectInOneClick class
 public JCheckBoxMultipleSelectInOneClick()
 {
  //Set JFrame title
  super("Select All JCheckBox In One Click");
  
  //Set JFrame layout
  setLayout(new GridLayout(4,1));
  
  //Add action listener to JCheckBox a
  a.addActionListener(this);
  
  //Add JCheckBox into JFrame
  add(a);
  add(b);
  add(c);
  add(d);
  
  //Set JFrame's default close operation when click on close window button
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
  //Set JFrame size
  setSize(400,400);
  
  //Make JFrame locate at the center of screen
  setLocationRelativeTo(null);
  
  //Make JFrame visible to see
  setVisible(true);
 }
 
 //Override actionPerformed method in ActionListener interface
 public void actionPerformed(ActionEvent e)
 {
  if(e.getSource()==a)
  {
   //Set all JCheckBox to select when JCheckBox a is select  
   if(a.isSelected()==true)
   {
    b.setSelected(true);
    c.setSelected(true);
    d.setSelected(true);
   }
   
   //Set all JCheckBox to unselect when JCheckBox a is select 
   else
   {
    b.setSelected(false);
    c.setSelected(false);
    d.setSelected(false);
   }
  }
 }

 //Main method where this program start
 public static void main(String[]args)
 {
  JCheckBoxMultipleSelectInOneClick myFirstObject = new JCheckBoxMultipleSelectInOneClick();
 }
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************

A Java Program To Play A MP3 File Using JLayer

Watch video tutorial below :


*********************************************************************
COMPLETE SOURCE CODE FOR : TestPlay.java
*********************************************************************

import javazoom.jl.player.Player;
import java.io.FileInputStream;

public class TestPlay
{
    public static void main(String[]args)
    {
        try
        {
            FileInputStream fis=new FileInputStream("C:\\Documents and Settings\\UserXP\\Desktop\\01-flo_rida_(feat_david_guetta)-clab_cant_handle_me.mp3");
            Player playMp3=new Player(fis);

            playMp3.play();
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
    }
}

RELAXING NATURE VIDEO