Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-09-2008, 05:38 PM
Member
 
Join Date: Jan 2008
Posts: 5
hien_NU is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-10-2008, 03:18 AM
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using reflection to check array type and length Java Tip java.lang 0 04-14-2008 10:42 PM
How to check whether file is exists or not Java Tip java.io 0 04-05-2008 12:13 PM
Check if a web page exists or not Java Tip Java Tips 0 03-02-2008 09:24 PM
questions about using array to store profile hien_NU New To Java 6 01-08-2008 07:03 AM
File fp = new File(filePath);fp.exists() does not yeild proper result ganeshp Advanced Java 1 12-27-2007 01:42 AM


All times are GMT +3. The time now is 01:14 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org