B4J Code Snippet Set default button

Author: @stevel05

Allows you to set the button whose Click event will be executed when the Enter key is pressed.

This is especially useful in dialog forms. It can be used, for example, to set the default button of a B4XDialog (see this post).

B4X:
Button1.As(JavaObject).RunMethod("setDefaultButton", Array(True))

Button1 can be declared as either a Button or a B4XView.
 
Top