Results 1 to 8 of 8
- 03-15-2010, 12:25 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 12
- Rep Power
- 0
- 03-15-2010, 12:35 PM #2
u might be having a button called "login" in ur GUI.
Attach actionlistener to that button by using
"buttonName.addActionListener()
and in the actionPerformed method write the simple code to check whether the text box has a number or not .. if not generate pop-up to show error msg.
so simple...
still have confusion post or efforts..(codes)
- 03-15-2010, 12:42 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 12
- Rep Power
- 0
Hmm, I've already using the actionlistener.
But what I'm asking is, I just want the field to accept only inputs from numbers (String like alphabet can't). How to do that? cause now if I input with alphabet the field still accept it.
- 03-15-2010, 12:48 PM #4
you want to check it at the very time when u enter data in textfield OR
u want to check it wen u click on login button.?
- 03-15-2010, 12:53 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
- 03-15-2010, 01:09 PM #6
Member
- Join Date
- Mar 2010
- Posts
- 12
- Rep Power
- 0
@programmer_007
Check when I click Login Button.
@JosAH
Where can I find API Documentation?
Thanks to both of you.
- 03-15-2010, 01:40 PM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
Here it is,bookmark it and never program without it.
kind regards,
Jos
- 04-10-2010, 11:31 AM #8
Member
- Join Date
- Mar 2010
- Posts
- 12
- Rep Power
- 0
Similar Threads
-
printing number of pos/neg numbers input?
By shroomiin in forum New To JavaReplies: 12Last Post: 09-25-2009, 02:15 AM -
Convert Input from JTextField to int?
By jls7168 in forum New To JavaReplies: 7Last Post: 02-20-2009, 02:29 AM -
JTextField add numbers advice
By thelinuxguy in forum Advanced JavaReplies: 9Last Post: 02-20-2009, 02:03 AM -
Constraining Input in JTextField
By kataya in forum AWT / SwingReplies: 1Last Post: 06-26-2008, 06:25 PM -
how to display a sum of all previously pressed numbers in JTextField?
By all eyes in forum New To JavaReplies: 2Last Post: 03-30-2008, 08:38 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks