SunQuest
 
           Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old March 14th, 2004, 12:00 PM
kjoker kjoker is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 kjoker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy need help with java empty field validation

Hello,

Can someone help me? Beginner with Java here. I'm trying to do a blank field validation. So far I got tons of errors. I tried so many different methods of validation code but no luck. I can't get the JOptionPane to show.

Here are the errors:
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Num berFormatException.
java:48)
at java.lang.Integer.parseInt(Integer.java:489)
at java.lang.Integer.parseInt(Integer.java:518)
at PanelGroup.actionPerformed(PanelGroup.java:104)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:17
86)
at javax.swing.AbstractButton$ForwardActionEvents.act ionPerformed(Abstra
ctButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel
.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:258
)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonL
istener.java:245)
at java.awt.Component.processMouseEvent(Component.jav a:5100)
at java.awt.Component.processEvent(Component.java:489 7)
at java.awt.Container.processEvent(Container.java:156 9)
at java.awt.Component.dispatchEventImpl(Component.jav a:3615)
at java.awt.Container.dispatchEventImpl(Container.jav a:1627)
at java.awt.Component.dispatchEvent(Component.java:34 77)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:3483
)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3198)

at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3128)
at java.awt.Container.dispatchEventImpl(Container.jav a:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606 )
at java.awt.Component.dispatchEvent(Component.java:34 77)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 456)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchTh
read.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThre
ad.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:100)

Here's my code:
if(betField.getText().equals (""))
{
JOptionPane.showMessageDialog(null, "Show me the money!");
return;
//validation if the user didn't enter anything on the bet field
}


Been trying to fix this for 3 days...no luck.
Thanks.

Reply With Quote
  #2  
Old March 17th, 2004, 09:47 AM
michlmann michlmann is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 56 michlmann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Would need more information:

- from which class do you instantiate your betField?

- when do you validate (listeners, input verifiers etc.)?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > need help with java empty field validation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway