Don't know if this will work but it might be worth a go.  It sounds like you
need to defer the doClick a while longer.  Try adding an AncestorListener to
the button and calling doClick when ancestorAdded is called (possibly in an
invokeLater but I don't think that would be necessary).

I assume the effect you're after is to have the table display a button which
brings up the popup when it is 'pressed'.  It sounds as if you've arrange
for the action of the button to bring up the popup and you're trying to make
that happen automatically.  Instead of using the button to invoke the popup
you could do this directly as in:

public Component getTableCellEditorComponent
        (JTable table, Object value, boolean isSelected, int row, int
column) {
    //display the popup
    ...

    //now the popup's displayed we don't really want to edit with the
'button'
    return null;
}


Regards

Dave Wathen
Goldman Sachs Asset Management
3rd Floor, Procession House
55 Ludgate Hill
London EC4M 7JN
+44 (0)20-7774-2998

It is not necessary to understand things in order to argue about them.
(Caron de Beaumarchais)


-----Original Message-----
From: Steve Barrett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 08, 2001 6:57 PM
To: [EMAIL PROTECTED]
Subject: isCellEditable() question 


I am using a table which has a button that implements
CellEditor.  I want a single click in the table to
make the button do its thing so I have
isCellEditable() returning true if the event is a
mouse event with a click count == 1.  In the
getCellEditor() I call the button's doClick() in an
invokeLater() thread.  If I don't call the doClick()
then I have to click again, and if I don't do it in an
invokeLater() then then menu does not display
(presumably because the table hasn't given my
component some real estate).   The problem is that the
1st popup menu item is immediatly selected if the menu
pops up under the mouse pointer.  I have tried
consuming the event in the isCellEditable() as well as
disabling event listening and neither have worked. 
Any suggestions would be appreciated.
Oh yeah: Win9x, JDK 1.3.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to