I am getting the following error when trying to execute right-click commands for pieces in my module:
An untrapped error has occured.
NullPointerException
Please send report to…
To demonstrate this error, I made a test module which reproduced the error on my machine.
New module->
Defined a board using a colored square of the default size.
Went to game piece prototype definitions. Right clicked and selected Add Definition.
Under Name, I called it Emotional piece. The only traits I selected were Delete and Dynamic Property.
Under Dynamic Property, Name, I typed Emotion and set default value to Happy.
Under Key Commands, I made two commands. The first menu command I named Sad, deleted the keyboard shortcut, set type to Set value directly, and set New value to Sad.
The second menu command I named Happy, deleted the keyboard shortcut, set type to Set value directly, and set New value to Happy.
Under Game Piece Palette, I selected Add single piece. Under Basic Piece, I loaded a 2k gif picture from the internet of a happy face and named it Piece 1. I then added Prototype and in the Prototype dialog box, I typed in the name Emotional piece.
I then saved the module and ran it. I can drag the piece from the palette to the board. When I right click on it, I see Delete, Sad, and Happy as my three choices. Delete works ok. Happy and Sad, if I choose them from the right click menu, give me the Nullpointerexception.
When I first did this, even Delete gave me the Nullpointerexception. I deleted Java, reinstalled the latest beta 6u10, and restarted my computer. After that, Delete worked ok. But the other right click commands still give me the error.
I made the test module above as simple as I could to reproduce my error and (for better or worse) it did.
Is it VASSAL? Java? Did I miss something in the program above?
My error log is as follows:
– OS Windows XP
– Java version 1.6.0_10-beta
– VASSAL version 3.0.17
– Unnamed module version 0.0
java.lang.NullPointerException
at VASSAL.counters.KeyBuffer.keyCommand(KeyBuffer.java:108)
at VASSAL.counters.KeyCommand.actionPerformed(KeyCommand.java:103)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)