This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

mouse events Windows vs. Apple  RSS feed

Mike Dahmus
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing a Swing component which must function similarly on Apple and Windows; and am having trouble with which event to fire off of
(this is effectively a toggle button which would ideally just be interested in mouseClicked). For a variety of other reasons, I don't want to make my code act on the mousePressed event.
Originally, our QA person asserted that it was busted because she was clicking (and moving the mouse > 10 pixels) and it wasn't getting "toggled" (this was on Windows). I won the battle there by saying "don't move it 10 pixels; that's a drag, not a click". (after debugging and figuring out that if you moved the mouse more than approximately that much, the mouseClicked never came in).
However, she now claims that on Apple (OSX) that the button fails to toggle if you move the mouse even one pixel while pressing the button. (i.e. if you are not perfectly still while clicking).
Obviously this would be a different story. I don't have immediate access to an Apple machine, so was wondering if anybody else had seen this behavior. When I worked on the AWT on OS/2 at IBM, it was fairly clear that the mouse events were determined based on native operating system events (i.e. when Windows says it is a click, we'll say it is a click). Don't know if that's true now or not, since I haven't seen the code since Java 1.1.8.
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!