Problem with NamedKeyStroke

I have created my own, custom Button (based on DoActionButton but it calls given class and method).

The problem is I can’t have it respond to key strokes because Vassal can’t load VASSAL.tools.NamedKeyStroke.class:

java.lang.NoClassDefFoundError: VASSAL/tools/NamedKeyStroke at rsr.RsrButton.getAttributeTypes(RsrButton.java:92) at VASSAL.configure.AutoConfigurer.<init>(AutoConfigurer.java:75) at VASSAL.build.AbstractConfigurable.getConfigurer(AbstractConfigurable.java:172) at VASSAL.configure.ConfigureTree$5.actionPerformed(ConfigureTree.java:423) [...] Caused by: java.lang.ClassNotFoundException: Unable to load class VASSAL.tools.NamedKeyStroke at VASSAL.tools.DataArchive.findClass(DataArchive.java:373) at VASSAL.tools.DataArchive.loadClass(DataArchive.java:346) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 31 more Caused by: java.io.FileNotFoundException: 'VASSAL/tools/NamedKeyStroke.class' not found in E:\dominik\gry\VASSAL\Rsr-v400_solo.zip at VASSAL.tools.DataArchive.getInputStream(DataArchive.java:194) at VASSAL.tools.ArchiveWriter.getInputStream(ArchiveWriter.java:231) at VASSAL.tools.DataArchive.findClass(DataArchive.java:368) ... 34 more

Why whould it try to load that class from my module when it should be in Vassal core?

I have not done anything really special in my code (it’s basically the same button but with less parameters) and it compiles normally.

Ok, my fault, by checking Vengine.jar and it’s contents I see in the compiled classes that NamedKeyStroke is not used anymore in those sources. Propably somethings wrong with my copy of Vassal source.

I will switch to javax.swing.KeyStroke instead.

Maybe I’m connected to wrong repository?

NamedKeyStroke is a class in the VASSAL 3.2 source (trunk). It does not exist in the 3.1 branch. Depends which branch you are using. NamedKeyStroke and javax.swing.KeyStroke are incompatible. I strongly suggest you be using the 3.1 branch.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Ok, I didn’t know that. I was always using trunk repository for compiling the module, while it was then run in normal version of Vassal downloaded from the site.