Text Input Prompt

Hi!

I want to prompt the user to input a string of text. I am currently using swing to make a nice looking application.

My first thought is to make my own class that takes a line of text and a regular expression as parameters for the constructor. It will either let the user cancel or input text that matches that expression.

Does something like this exist, or do I need to program it myself?

David

[429 byte] By [Davida] at [2007-10-2 4:06:20]
# 1
Struts offers that functionality, but that's overkill if you're just trying a simple demo program. At the other end of the spectrum, you could simply call String.matches(), either when the field loses focus, or when the user submits the form.
Dick_Adamsa at 2007-7-15 23:29:12 > top of Java-index,Java Essentials,New To Java...
# 2
I found what I was looking for JOptionPaneDavid
Davida at 2007-7-15 23:29:12 > top of Java-index,Java Essentials,New To Java...