Results 1 to 2 of 2
- 01-09-2008, 04:38 PM #1Member
- Join Date
- Jan 2008
- Rep Power
How an array can check that profile whether exists or not???
I've declared an array containing profile 1, profile 2, and profile 3. Each profile contains name, job, nation...
Now, i want to declare a new profile (e.g profile 4). In profile 4, after inputing name, i want array to check that whether name exists or not. If name have existed in profile 1, 2 or 3. It will display message "Your name already exists. Do you want to update or not?".
Anyone can help me. plz?:confused:
- 01-10-2008, 02:18 AM #2
You can add an ActionListener to the textField which will send an ActionEvent when the user presses the "enter". In the listener you can read the name from the textField and then run through the array and look for the name in each array element. If you find it you can announce success to the user via a JOptionPane.showMessage/ConfirmDialog.
- By ganeshp in forum Advanced JavaReplies: 2Last Post: 04-07-2009, 07:25 AM
- By Java Tip in forum java.langReplies: 0Last Post: 04-14-2008, 09:42 PM
- By Java Tip in forum java.ioReplies: 0Last Post: 04-05-2008, 11:13 AM
- By Java Tip in forum Java TipReplies: 0Last Post: 03-02-2008, 08:24 PM
- By hien_NU in forum New To JavaReplies: 6Last Post: 01-08-2008, 06:03 AM