• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Firing a mouse clicked event

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to internally, fire a MouseClicked event, passing in a Point (or x,y coordinates) as to where that mouse click took place?
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure. Do you want to actually DO that click?
If you use the Robot class you can do a mouseMove(x,y) then a mousePress(button); and it will happen.
If you actually want to just stick something in the EventQueue it is a little more tricky.
 
G Estes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your suggestion about the Robot class. Hadn't thought of that. What I'm trying to accomplish is to have a cell in a JTable be selected via the TAB key, so that the cursor shows itself and the full text of the cell is selected as well. I'm not sure the Robot class is the way to go...as I should think something like editCell(row,col) should do it (but it's not).
Any other ideas?
 
G Estes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm looking at creating a MouseEvent and using the processMouseEvent(MouseEvent ev) method of the JTable. When I create a mouse event, it asks for a time (when) of the event, but the documentation I'm seeing doesn't say much about format other than it is a long. Any enlightenment?
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try
Bill
 
Message for you sir! I think it is a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic