Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  So yeah, weird error. ^^  (Read 1491 times)
0 Members and 1 Guest are viewing this topic.
Offline Regenuluz
« Posted 2012-10-23 06:47:22 »

So, I was just messing about with my mouse controller, just spam clicking on my window.. and all of a sudden, BAM! A flying monkey! ... Or rather, a flying error.. Tongue

1  
java[14452:707] Lookup: Unhandled exception 'JavaNativeException' caught in __56+[LULookupDefinitionModule focusTermUsingQueue:handler:]_block_invoke_0


I have no idea what that error means. It didn't look like anything stopped working either as it kept printing my mouse coords whenever I clicked the mouse.

Here's my super simple input class:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
public class MouseController extends MouseInputAdapter {
   
   private static boolean clicked = false;
   private static Point mousePosition = new Point();

   public static boolean clicked() {
      boolean val = MouseController.clicked;
      MouseController.clicked = false;
      return val;
   }
   
   public static Point getPosition() {
      return MouseController.mousePosition;
   }
   
   @Override
   public void mouseClicked(MouseEvent e) {
      MouseController.clicked = true;
   }
   
   @Override
   public void mouseMoved(MouseEvent e) {
      MouseController.mousePosition.x = e.getX();
      MouseController.mousePosition.y = e.getY();

      MouseController.clicked = false;
   }
}


Anyone has any idea of what caused that error? ^^

Cheers! Cheesy
Offline ReBirth
« Reply #1 - Posted 2012-10-23 12:44:04 »

And eclipse showed nothing when you typing the codes? must be a line that cause all of this, and why it doesnt appear on exception log?!

Offline alesky

Junior Member


Medals: 3
Exp: 15 years


mmm....


« Reply #2 - Posted 2012-10-23 13:14:35 »

what SO are you using?

please try to comment all the access to static memeber in your class and test it and let us to know if it works,
i mean if it not crash

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
 @Override
   public void mouseClicked(MouseEvent e) {
      //MouseController.clicked = true;
  }
   
   @Override
   public void mouseMoved(MouseEvent e) {
      //MouseController.mousePosition.x = e.getX();
     //MouseController.mousePosition.y = e.getY();

      //MouseController.clicked = false;
  }


try also to substitute mouseClicked(MouseEvent e) with  mousePressed(MouseEvent e)


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Regenuluz
« Reply #3 - Posted 2012-10-23 18:20:47 »

And eclipse showed nothing when you typing the codes? must be a line that cause all of this, and why it doesnt appear on exception log?!

When I typed in the codes? There's no syntax error etc. in my code. Tongue It just happened randomly while I was just clicking the mouse for a while.

what SO are you using?

please try to comment all the access to static memeber in your class and test it and let us to know if it works,
i mean if it not crash

Trouble is, I couldn't reproduce the error. I kept clicking around for a few minutes without anything bugging out. Besides, it didn't kill my app, it just spewed that error to the console.

Oh, and I'm using osx. Smiley
Offline ReBirth
« Reply #4 - Posted 2012-10-24 02:06:58 »



I was just clicking
Means your code works (constructor and init phase passed) and error happened on your mouseClicked().

Offline Regenuluz
« Reply #5 - Posted 2012-10-24 06:06:04 »

Well, like I said, the program didn't crash or anything, I could continue clicking and getting a response after it gave me that error. And I haven't been able to generate it again.

My mouseClicked() only sets a variable to true, so there isn't a whole lot that can go wrong there ^^

And this is the code that is run when the mouse is clicked.

1  
2  
3  
if(MouseController.clicked()) {
   this.entities.add(new Block(MouseController.getPosition().x, MouseController.getPosition().y));
}


But I was just curious about the error, it didn't seem like it broke anything. Smiley
Offline theagentd
« Reply #6 - Posted 2012-10-24 12:51:40 »

An extremely rare VM bug? Unstable overclock?

Myomyomyo.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #7 - Posted 2012-10-24 16:45:08 »

Probably just wonky data from the device that didn't get filtered by the driver.   Happens all the time with pointing devices.
Offline theagentd
« Reply #8 - Posted 2012-10-24 23:42:59 »

Probably just wonky data from the device that didn't get filtered by the driver.   Happens all the time with pointing devices.

"BEWARE OF THE WONKY DATA!!!"
 persecutioncomplex

Myomyomyo.
Offline Best Username Ever

Junior Member





« Reply #9 - Posted 2012-10-25 03:16:52 »

It's probably not a driver issue. Mouse clicks should be the simplest thing the driver has to handle. You've got several layers working to ensure correctness, the software inside the mouse, the driver for the mouse, which is probably a generic one tested on many kinds of mice, (possibly) the operating system, and (possibly) the JVM. The first three layers should all filter bad data. When the input data finally reaches the application, it should look like the mouse is behaving correctly even if some other glitch affected that data. The user should not be able to break a program with a bunch of random mouse clicks.

I am guessing it's a JVM implementation bug. The Mac implementation has been problematic for as long as I can remember for longer than I've been using Java, usually in some odd, face-palm worthy way. Don't worry about changing your code to prevent it, since there isn't anything you can do to fix that. Your mouse events should normally be reliable and don't need to be filtered/corrected on an application level.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Regenuluz
« Reply #10 - Posted 2012-10-25 05:56:48 »

Yeah, I figured it was something strange like that and since it didn't seem to break my app, then meh, I don't care. I was just curious about it. Smiley

Thanks for all the replies folks! Cheesy
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (25 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!