Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
validatable
validator: { v ->
try{
v = parseInt(v)
} catch (NumberFormatException e) {
field.background = Color.RED
field.revalidate()
return false
}
if (v >= 0 && v < MAX_VALUE) {
field.background = Color.WHITE
field.revalidate()
return true
} else {
field.background = Color.RED
field.revalidate()
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.