Title: Message
That cannot happen, because I'm using the same code for exactly the same purpose. May be your if condition is not same. This code does not see which is the button, but just how many times it clicked. You need to mask BUTTON1_MASK or use SwingUtilities.isLeftMouseButton(MouseEvent)if you are interested only in left button. So the code will be
 
  addMouseListener(new MouseAdapter(){
   public void mouseClicked(MouseEvent e){
    if ((SwingUtilities.isLeftMouseButton(e)) &&(e.getClickCount() == 2) ){
        // Do your processing here
    }
   }
  });
I suggest you go through the tutorials at java site. It is very helpful for the common problems.
 
regards,
Krishna
-----Original Message-----
From: Bhangale, Bhushan [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 07, 2002 1:26 AM
To: Krishnakumar CS
Subject: RE: JTable row selection

It works but for right mouse button. Is there any way to capture any thing of left button?
 
-----Original Message-----
From: Krishnakumar CS [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 9:34 AM
To: 'Bhangale, Bhushan'
Subject: RE: JTable row selection

  addMouseListener(new MouseAdapter(){
   public void mouseClicked(MouseEvent e){
    if (e.getClickCount() == 2){
        // Do your processing here
    }
   }
  });
Add this listener to the table.
-----Original Message-----
From: Bhangale, Bhushan [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 12:45 AM
To: 'Advanced-Swing'
Subject: RE: JTable row selection

I tried the following MouseAdapter but it listens only right click of mouse. What about left button click? I want to capture double click of left mouse button but I don't see any method in mouselistener.
 
 class LogMessageTableMouseListener extends MouseAdapter {
 
  JTable logMessageTable;
 
  public LogMessageTableMouseListener(JTable logMessageTable) {
   this.logMessageTable = logMessageTable;
  }
 
  public void mouseReleased(MouseEvent event) {
 
   if (event.isShiftDown() || event.isControlDown() || event.isAltDown()) {
    return;
   }
 
   if (event.isMetaDown()) {
    int row = logMessageTable.rowAtPoint(event.getPoint());
    int column = logMessageTable.columnAtPoint(event.getPoint());
    LogManager.log.debug("The clicked row data " + logMessageTable.getModel().getValueAt(row, column));
   }
  }
 }
 
-----Original Message-----
From: Bhangale, Bhushan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 2:20 PM
To: 'Advanced-Swing'
Subject: JTable row selection

Hi All,
 
I have a JTable in which I am showing 4 columns. When a user double clicks on a particular row I have to open a popup and show the data of that row in some form. How to do it? Can I add mouse double click kind of listener on table rows? If yes then how?
 
Thanks & Regards
Bhushan Bhangale
Sr. Software Engineer
Fusion Infotech India Private Ltd.
Ph. no. - 1-212-641-6932 (O)
 


"The information in this e-mail, and any attachment therein, is

confidential and for use by the addressee only. If you are not the

intended recipient, please return the e-mail to the sender and delete

it from your computer. Although The Bank of New York attempts to

sweep e-mail and attachments for viruses, it does not guarantee that

either are virus-free and accepts no liability for any damage sustained

as a result of viruses."




"The information in this e-mail, and any attachment therein, is

confidential and for use by the addressee only. If you are not the

intended recipient, please return the e-mail to the sender and delete

it from your computer. Although The Bank of New York attempts to

sweep e-mail and attachments for viruses, it does not guarantee that

either are virus-free and accepts no liability for any damage sustained

as a result of viruses."




"The information in this e-mail, and any attachment therein, is

confidential and for use by the addressee only. If you are not the

intended recipient, please return the e-mail to the sender and delete

it from your computer. Although The Bank of New York attempts to

sweep e-mail and attachments for viruses, it does not guarantee that

either are virus-free and accepts no liability for any damage sustained

as a result of viruses."


Reply via email to