Thanks for the suggestions. I won't be able to try
this for a bit but while I have your attention let me
ask some followup questions (hope you don't mind me
pickin your brain a bit!):
Does the ancestor event mean that the component is
displayed and in some kind of state of readiness?
I know JTable will propogate the event
isCellEditable() checked and blessed, but why is the
popup menu recieving it? Didn't the button consume
the event or doesn't the popup care if the event is
consumed?
If I return null, what happens to the display, I ask
because if my renderer is called to fast it messes up
some state information?
Do you know if I can use something like
getCellRect(row, col) to get a location for the popup?
The whole table is in a scrollpane, if the rectangle
is in table coordinates and if the table is the
invoker, where will the popup get displayed? Do I map
the rectangle x,y to the scrollpane or something?
Thanks for your time, really do appreciate it!
Steve
--- "Wathen, Dave" <[EMAIL PROTECTED]> wrote:
> 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-swin
__________________________________________________
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