Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2004

Tip: Looking for answers? Try searching our database.

Newbie questions

Thread view: 
Allen - 11 May 2004 20:51 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
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.