Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

G4P use GTextField for number entry only

$
0
0

I'm working on a program that takes a grid of numbers as inputs. I'd like to use GTextField objects to enter each number. As far as I can tell, there's no easy way to limit the possible characters to the digits 0-9 only. I think I know how to make an event handler that's called whenever a text field changes, and simply deletes any wrong characters. The problem I'm running into here is that I'd need to find a way to scale this to work with multiple text fields. I would prefer not to have a separate event handler for each text field, as this would result in many copies of the same code, just with different method names. Any suggestions how I could go about doing this?


Viewing all articles
Browse latest Browse all 2896

Trending Articles