This topic has been locked.
3 replies Latest Post - 2010-06-29T18:50:14Z by Kinow
Pinned topic empty space problem
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Please see file attached for problem's description
Updated on 2010-06-29T18:50:14Z at 2010-06-29T18:50:14Z by Kinow
Hasene 2700038RHX2 PostsACCEPTED ANSWER
Re: empty space problem2010-06-12T03:55:13Z in response to POWERBUILDERI really didnt get your question properly.
But if the validation of empty space is your problem, then you can use the condition,
if(fieldname.length()!=0 && fieldname != null)
do any operation with field
Hasene 2700038RHX2 Posts
Kinow 0600023DQ81 PostACCEPTED ANSWER
Re: empty space problem2010-06-29T18:50:14Z in response to HaseneHey there,
quite old post. I didn't understand your problem either. However I agree that you should do something like Hasene proposed.
The only point is that the code:
if(fieldname.trim().length()!=0 && fieldname != null)
Might throw NullPointerException if the fieldname is null. You have to swap the order of the boolean expressions.
if( fieldname != null && fieldname.trim().length()!=0)
Btw, in case you're using Swing as GUI API, perhaps you could google for ready-to-use Swing components with embedded validation. I used one once, I think it was part of JGoodies Open Source applications.