

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Point;

import javax.swing.JButton;
import javax.swing.JColorChooser;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.border.TitledBorder;
import javax.swing.border.LineBorder;
import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JSeparator;
import javax.swing.JCheckBox;
import javax.swing.JTable;

public class Test_dialog extends JDialog 
{

		private JTable table;
	 	
	 	public Test_dialog(JFrame f, boolean modal) 
	 	{
			
	 		 super(f, modal);
	 		 
	 		 // decalage par rapport au frame
	 	     Point location = f.getLocation();
	 	     setLocation(location.x + 250, location.y + 250);
	 		 
	 		 init();
			
			
	 	}
	 	
	 	private void init()
		{
	 		
	 		setResizable( false );
		  	setBounds(100, 100, 600, 460);
			getContentPane().setLayout(null);
		    	 
	     	
			
			setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
			setTitle("Settings state parameters ");
			
			
			
			String data[][]={ {"101","Amit","670000"},    
	                {"102","Jai","780000"},    
	                {"101","Sachin","700000"}};    
			String column[]={"ID","NAME","SALARY"};         
			
			JScrollPane scrollPane = new JScrollPane();
			scrollPane.setBounds(34, 24, 525, 189);
			getContentPane().add(scrollPane);

			JTable jt=new JTable(data,column);
			scrollPane.setViewportView(jt);
			
			/*******************/
			
			JSeparator separator = new JSeparator();
			separator.setBounds(1, 384, 600, 2);
			getContentPane().add(separator);
		
			/*******************/
			
			JButton btn_ok = new JButton("OK");
			btn_ok.addActionListener(new ActionListener() 
			{
				public void actionPerformed(ActionEvent arg0) 
				{
				
					System.out.println("Btn Cancel  \n");
					dispose();
				}
			});
			btn_ok.setBounds(135, 391, 89, 23);
			getContentPane().add(btn_ok);
		
			/*******************/
			
			JButton btn_cancel = new JButton("Cancel");
			btn_cancel.addActionListener(new ActionListener() 
			{
				public void actionPerformed(ActionEvent e) 
				{
					
					System.out.println("Btn Cancel  \n");
					dispose();
				}
			});
			btn_cancel.setBounds(359, 391, 89, 23);
			getContentPane().add(btn_cancel);
			
			JButton Btn_add = new JButton("Add");
			Btn_add.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {
				}
			});
			Btn_add.setBounds(65, 242, 89, 23);
			getContentPane().add(Btn_add);
			
			JButton btn_remove = new JButton("Remove");
			btn_remove.setBounds(65, 276, 89, 23);
			getContentPane().add(btn_remove);
			
	 		
		}
}
