I am a relative newcomer to Java and am using the Netbeans 3.6 IDE. I have
a couple of small projects that I am using to learn the basics. One is an
insurance form and all the text fields need to be filled in. I have tried
to validate this by using something along the lines of:
if txtAge.getText("")
doSomething;
else
doSomeThingElse;
This throws an error. Can somebody point me in the right direction for
validation of a text field?
My other project is a calculation project. It hasd 2 text fields for
entering numbers and four radio buttons to choose wether to add, subtract,
multiply or divide. I cannot figure out how to determinw which radio button
is selected!! Help!!!!!
TIA

Signature
ats@home
When an old lady got hit by a truck
I saw a wicked gleam in your eye
Handy utils here: http://www.allenjones.co.uk/utils.htm
Andrew Thompson - 11 May 2004 21:00 GMT
F'Ups set to c.l.j.help
> I am a relative newcomer to Java ...
<http://www.physci.org/codes/javafaq.jsp#cljh>
>..and am using the Netbeans 3.6 IDE.
<http://www.xdweb.net/~dibblego/java/faq/answers.html#q34>
> insurance form and all the text fields need to be filled in. I have tried
> to validate this by using something along the lines of:
...
> This throws an error.
<http://www.physci.org/codes/javafaq.jsp#exact>
> ...Can somebody point me in the right direction ...
<http://www.physci.org/codes/sscce.jsp>
> My other project is a calculation project.
Woah there!
One noob problem at a time, please!

Signature
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Roedy Green - 11 May 2004 21:23 GMT
>if txtAge.getText("")
> doSomething;
[quoted text clipped - 3 lines]
>This throws an error. Can somebody point me in the right direction for
>validation of a text field?
this is not Java code by a long shot. At least get it to compile
before posting.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
SZDev - Slash - 13 May 2004 19:16 GMT
> I am a relative newcomer to Java and am using the Netbeans 3.6 IDE. I have
> a couple of small projects that I am using to learn the basics. One is an
[quoted text clipped - 5 lines]
> else
> doSomeThingElse;
may be
if (txtAge.getText().equals(""))
doSomething();
else
doSomethingElse();
> This throws an error. Can somebody point me in the right direction for
> validation of a text field?
[quoted text clipped - 3 lines]
> multiply or divide. I cannot figure out how to determinw which radio button
> is selected!! Help!!!!!
You must add all the radioButtons to a ButtonGroup, this way only one can be
selected at the time.
Then you can call radioButton.isSelected()
> TIA
>
[quoted text clipped - 5 lines]
>
> Handy utils here: http://www.allenjones.co.uk/utils.htm
Santiago Zapata
SZDev/Slash