P
Perfect Reign
I apologize for a newbie question, but I'm just starting with Java.
I'm trying to write a program which includes a class for checking if a
given text field has a value.
My basic logic would run something like:
A button is pressed
On that event, check if a text field has a value
if it does, return true, else return false.
So, I want to say in the action listener event for that button something
like:
if ( checkValue( txtFieldName ) == true)
do something
else
do something else
I'd then have a public funciton for checking the value
public checkValue( String txtFieldName )
{
if ( txtFieldName == "" )
return false;
else
return true;
}
This keeps giving me an error that a return code is needed for a public
class. If i put void in the class, I can run it but then nothing gets
returned.
Now, a bit of background - I've been doing VB for 12 years, so maybe my
thinking is flawed. If so, is there another way of going about this? I've
googled for the past hour and am very frustrated.
--
kai - (e-mail address removed) - www.perfectreign.com
kai:/> format a:
Error: The DOS concept of formatting disk media is screwed.
To format a floppy, use "fdformat /dev/fd0"
and then "mkfs.minix /dev/fd0".
I'm trying to write a program which includes a class for checking if a
given text field has a value.
My basic logic would run something like:
A button is pressed
On that event, check if a text field has a value
if it does, return true, else return false.
So, I want to say in the action listener event for that button something
like:
if ( checkValue( txtFieldName ) == true)
do something
else
do something else
I'd then have a public funciton for checking the value
public checkValue( String txtFieldName )
{
if ( txtFieldName == "" )
return false;
else
return true;
}
This keeps giving me an error that a return code is needed for a public
class. If i put void in the class, I can run it but then nothing gets
returned.
Now, a bit of background - I've been doing VB for 12 years, so maybe my
thinking is flawed. If so, is there another way of going about this? I've
googled for the past hour and am very frustrated.
--
kai - (e-mail address removed) - www.perfectreign.com
kai:/> format a:
Error: The DOS concept of formatting disk media is screwed.
To format a floppy, use "fdformat /dev/fd0"
and then "mkfs.minix /dev/fd0".