This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I've got a text box that expects a double between 0.1 and 0.99. I would like to validate this right when the user enters the number and then tries to change the focus to another component. Is there data validation built in to Java? NetBeans?
Jeff Ciaccio, Java novice <br />Physics and AP Physics Teacher<br />Sprayberry High School <br />Marietta, GA
Sounds like something which would sit better on the Swing forum. Moving.
Joined: Nov 26, 2008
I'm very green with Java, so I just wanted to do something simple like:
1) cast the text as double (but I'm not sure how)
2) do an if then to check:
if (txt > double is < 0.1 or > .99) then set focus back on textBox and change the label's font color to red and bold