I have a B4J program with a button added using Designer.
The button just has the text label "+"
When I run the program and press the SPACE key, the CLICK event for this button is executed.
How do I remove the keyboard sensitivity from this button.
I have NOT assign a key listener to the button.
Looking online I see the object InputMap for jButtons, and
an InputMap has a Clear function.
I tried writing this function.
Public Sub ClearButtonKeypresses(ThisButton As Button)
Private nativeMe As JavaObject=Me
nativeMe.RunMethod("clearButtonInputMap",Array(ThisButton))
End Sub
#if JAVA
import javax.swing.InputMap;
import javax.swing.JButton;
public void clearButtonInputMap(JButton button) throws Exception
{
InputMap inputMap = button.getInputMap();
inputMap.clear();
}
#end if
When I pass the B4j Button to the Java code I get...
java.lang.RuntimeException: Method: clearButtonInputMap not matched.
I would welcome any helps resolving this, or
another method of clearing any associated keys from a button.