Tuesday, August 18, 2015

if Construct



int age;
age=Integer.parseInt(jTextField1.getText());
if(age<=0)
{
    jLabel2.setText("ERROR");
}
else
{
    if(age>0 && age<=50 )
    {
        jLabel2.setText("Young Age");
    }
    else
    {
        jLabel2.setText("Old Age");
    }
}

No comments:

Post a Comment