i need assistance with a string triggered loop please!
Greetings everyone,
ive been learning java in TAFE for a few weeks now and im having a go at a simple program but im a bit stuck on how where to implament the loop and how to trigger it using a string. ive done some reading and there is a way to "count" the length of a string through command line interface, like this one...
--------------------------
import java.io.*;
class StringLength{
public static void main(String[] args){
try{
BufferedReader object=new BufferedReader (new InputStreamReader(System.in));
System.out.println("Eneter string value:");
String s=object.readLine();
int len=s.length();
System.out.println(len);
}
catch(Exception e){}
}
}
-----------------------------------------
however my program is using dialog boxes through "javax.swing.*"
is there a way to do this too, the program i am doing is quite simple, just entering people's name and age, calculating their membership fee (the program is for gym membership),and a few other bits and pieces then displaying the ammount of people entered and the average age. my problem lies in getting the dialog boxes to pop up infinately untill you enter a blank name or a specific name like "quit"
any help is apriciated, because my textboox "First book of java" by Garry j Bronson is not very informative about what i am after :(
ill post up my current program seporately, it'll keep it a bit neater i think.
well, thanks in advance and feel free to critisise, its a great way to learn :D