alexiel davis

Greenhorn
+ Follow
since Sep 14, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by alexiel davis

Actually I am hoping that someone can give me a example on how to pass value from combo box to textarea. I have done one..but it doesn't works.


19 years ago
I wrote the following code using the treemap to generate ID customer,put it to the treemap and try to validate the customer details. Unfortunately before I can even validate the customer details...i meet some prob with generating the ID...

public class Customer extends Account
{private String ID; //declare instance variable for customer record
Customer( String ID, ....)//constructor to create customer obj
this.ID = ID;.......//construct new customer record with details
then.....
public void createCust() throws IOException
{System.out.print("Your new ID: " + ID); //hope to show that createCust() method is being run it will show that a new ID is created
try{
if (TreeMap.size()== 0) //if there is no key-value in the treemap
ID = "000000";//then ID will be 000000
else
new Customer ID = TreeMap.lastkey() + 1;//if there is key-value then this new ID = the last key of the treemap + 1(e.g 000000 + 1 = 1
} catch (IOException ioe) {
System.out.println("IO error trying to give you your customer id!");
System.exit(0);
CustomerMap.put(ID, Customer); // associate ID with the collection of customer obj...
}

Right now I don't really know whether I have problem in logical reasoning or did I wrote the code wrongly...can someone help me to point out my error and teach me how should i go about it?Thanks...
20 years ago
What I was trying to do..
1. Prompt for the cust value like firstName.
2. Try to validate when I get my value. Write into the file and then I can generate the custid using treemap
3. When I try to validate the first value like firstname, I meet my first problem.How can I get to validate when the object is not created
if (firstName != null && firstName != firstName// how to compare to data in file when I don't know what to use to compare with the input(firstName).

So I guess that the only way I will know about the value that is stored in the Customers container is by using the get(CustID) method in the treemap. If it returns null,then the Customer does not exist in the container. Do I sound reasonable?
20 years ago
I am newbie in java ..so I need some help in validation in java...

surname = b.readLine();
if (surname != null && surname != surname1)
then fileOut.write(surname, 0, surname.length());//write in file
else System.out.println(" exisiting users or no users");

for example, I am creating a new customer, so I try to read and write input...when I try to validate for the customer name,i am searching whether if the same person exist...

how do they know that I am trying to refer my surname 1 as the existing value in text file?Any suggestion or ideas to enlighten me?
20 years ago