code: private void initButtons()
  	{
  		JButton selectAll = new JButton("Select all");
  		selectAll.addActionListener(new ActionListener()
  		{
  
  			@Override
  			public void actionPerformed(ActionEvent arg0)
  			{
  				for (int i = 0; i < 22; i++) {
  					namespaces.getModel().setValueAt(new Boolean(true), i, 1);
  				}
  
  			}
  		});
  		selectAll.setBounds(380, 10, 120, 25);
  		this.add(selectAll);
  
  		JButton unselectAll = new JButton("Unselect all");
  
  		unselectAll.addActionListener(new ActionListener()
  		{
  
  			@Override
  			public void actionPerformed(ActionEvent e)
  			{
  				for (int i = 0; i < 22; i++) {
  					namespaces.getModel().setValueAt(new Boolean(false), i, 1);
  				}
  
  			}
  		});
  
  		unselectAll.setBounds(380, 40, 120, 25);
  		this.add(unselectAll);
  	}
docs: Initialize two buttons: SelectAll and UnselectAll