title: java: dialog with 2 button for event "click on Jtable cell"?
body: <p>I have a jtable with "data" in my java project:</p>
  
  <pre><code>DefaultTableModel model=(DefaultTableModel)jTablePolicyView.getModel();
              for(Policy policy : sngltn.GetPerPolicies(cstmr.getPer()))
              {
                  model.addRow(new Object[] {String.valueOf(policy.getPolicyId()),...,....});
              }
  </code></pre>
  
  <p>I want that :</p>
  
  <ol>
  <li>for <strong>clicking on each cell</strong> in my jtable , <strong>will spring a dialog</strong>(not Form...).</li>
  <li>will be <strong>two buttons</strong> (with "my label") <strong>on this dialog</strong>.</li>
  <li>i will be able to <strong>determine what action will happen</strong>(this action <em>should use the contents of the cell</em>) <strong>for clicking each button</strong>.</li>
  </ol>
  
  <p><strong>So what I'm asking?</strong></p>
  
  <ol>
  <li><p>Is it possible? </p></li>
  <li><p>Example code, greatly help me...</p></li>
  </ol>
  
  <p>Thank!</p>
  
  <hr>
  
  <p>i try this code for my first mission(for clicking on each cell in my jtable)...
  but it's didnt work, why?</p>
  
  <p><strong>my code:</strong></p>
  
  <pre><code> public class UpdateCstmrForm extends javax.swing.JFrame 
   {
      ......        
         public UpdateCstmrForm(long person_id) throws Exception 
         {
                 DefaultTableModel model=(DefaultTableModel)jTablePolicyView.getModel();
                  .....
                 initComponents();
                 .....
                    for(Policy policy : sngltn.GetPerPolicies(cstmr.getPer()))
                    {
                      model.addRow(new Object[]  {......});
                    }                         
                 jTablePolicyView.addMouseListener(new MouseAdapter() 
                 {
                   public void mouseClicked(MouseEvent e) 
                   {
                     if (e.getClickCount() == 2) 
                     {
                          JTable target = (JTable)e.getSource();
                          int row = target.getSelectedRow();
                          int column = target.getSelectedColumn();
                          System.out.println(model.getValueAt(row, column));
                     }
                   }
                 }
           ..... 
        }
   }
  </code></pre>