views:

119

answers:

1

Hello, I want user to type some text in JTextField and it must match some "pattern".

Pattern is - int x, String("hours"), so f.e. 5 hours ; 12 hours etc.

I googled something with patterns, matchers, regex or whatever, and I am pretty confused.

If someone ever experienced similar problem, or knows how to handle mine, please post. Or at least some API to read ...

+1  A: 

JFormattedTextField should do.

Bozho