View Single Post
Old 05-07-2010, 03:46 PM   #7
wiffel
Member
wiffel is on a distinguished road
 
Posts: 19
Karma: 72
Join Date: Dec 2008
Device: bebook
Quote:
Originally Posted by Tumaini View Post
Here's a small update.
I've managed to run some test classes on the V3, writing some text to the screen, but I'm stuck at some very strange behaviour regarding key events.

In your HelloWindow.java class you have the following code:

Code:
class HelloWindowKeyAdapter extends KeyAdapter {
		public void keyPressed(KeyEvent keyevent) {
			// led.resume();

			if (keyevent.getCh() == KeyEvent.KEY_CANCEL)
				System.exit(0);

			if (keyevent.getCh() == KeyEvent.KEY_OK)
				runLua();

			// led.resume();
		}
	}
This throws a java.lang.VerifyError when I try to run it on the V3.
I've tried different methods to see what might be wrong.

I was able to print out both the char and respective int from keyevent.getCh() to the screen, so there's no error there.

I've even tested different if-statements without keyevent.getCh() and they work fine. I only get the error when I use if and keyevent.getCh() (or the instance variable ch) together.

Have you got any insights into this or any clues as to why it might throw this error here?
I'm not quite sure what is causing the error. My first guess would be that the classes.jar (or more correctly the KeyEvent class in the classes.jar) has been changed. I guess that would throw a VerifyError. On the other hand, this would throw an error even before your code would be executed. So, strange thing indeed. Is the error only thrown when the KeyEvent class is being accessed?

When I did this kind of development, I did compile and run my code against a 'normal' JME first. That way I could resolve most of the 'normal' bugs first. Did you try your code like that already ?

I'm a bit in a hectic time at work right now. But if I find some time tomorrow, I'll have a look at the new classes.jar in the current firmware (by the way, which one are you using?) If I manage to do so, I'll post the new one. At the least you would be sure that the problems are not caused by that.
wiffel is offline   Reply With Quote