Re: Programmatically clicking a JLabel in a JList

2016-06-10 Thread Pete Brunet
Thanks Andrej. On 6/9/16 1:07 AM, Andrej Golovnin wrote: > One more solution: > > MouseEvent clicked = > JLabel l = ... > > for (MouseListener ml : l.getMouseListeners()) { > ml.mouseClicked(clicked); > } > > But this solution only works if you don't have subclasses of JLabel > which over

Re: Programmatically clicking a JLabel in a JList

2016-06-08 Thread Andrej Golovnin
One more solution: MouseEvent clicked = JLabel l = ... for (MouseListener ml : l.getMouseListeners()) { ml.mouseClicked(clicked); } But this solution only works if you don't have subclasses of JLabel which override the #processMouseEvent(MouseEvent)-method. On Thu, Jun 9, 2016 at 7:44

Re: Programmatically clicking a JLabel in a JList

2016-06-08 Thread Andrej Golovnin
Hi Pete, you can either use java.awt.Robot or you can dispatch an event by calling java.awt.Component.dispatchEvent(AWTEvent). Best regards, Andrej Golovnin On Wed, Jun 8, 2016 at 10:46 PM, Pete Brunet wrote: > To add some accessibility support I need to programmatically click a > JLabel in a J

Programmatically clicking a JLabel in a JList

2016-06-08 Thread Pete Brunet
To add some accessibility support I need to programmatically click a JLabel in a JList. If I can figure out the code path for when this happens with a real click I can probably do what I need to do but as of yet I haven't figured it out. Does anyone on the list know at least part of the code path