View Single Post
  #7 (permalink)  
Old 11-14-2007, 09:16 AM
Phobos0001 Phobos0001 is offline
Member
 
Join Date: Nov 2007
Posts: 20
Phobos0001 is on a distinguished road
ok, ive been playing around with the code ive been given (cheers for that by the way) and ive come up with a very simple test and got it working, and its exactly what i wanted, and here it is, incase anyone is interested
Code:
import javax.swing.*; import java.text.*; import java.io.*; public class phrase { public static void main(String[] args) { String agebox, namebox; DecimalFormat num = new DecimalFormat(",##.00"); namebox =JOptionPane.showInputDialog("Enter Member's Name, leave blank to exit member entry "); // user input for name agebox =JOptionPane.showInputDialog("Enter Member's Age: "); int len=namebox.length(); if (len != 0 ) {JOptionPane.showMessageDialog(null,"len != 0", "WARNING!", JOptionPane.WARNING_MESSAGE);} else {JOptionPane.showMessageDialog(null,"else len == 0", "WARNING!", JOptionPane.WARNING_MESSAGE);} System.exit(0); } }
so now all i need to do is intergrate that into the membership program i am writing in my 2nd post, i think it might have to be a do-while loop? it has to be an infinate loop untill the "len == 0"

or would i just do an if-else to do this?
such as this bit os pesudo-code i threw together?
--------------------
if len == 0 then display totals
else show age dialog box
----------------

or something more like this...
-------
do age dialog box
while len !0 0
--------

im a bit at a loss but i'll get it eventualy, thankyou so much for the help so far everyone
Reply With Quote