|
-
March 2nd, 2000, 09:42 AM
#1
TextField Please read this I have a Problem Please Help!!
I am writing an application
I created one TextField and one Button.
The user specifies a month and a year on the
Textfield,
Ex 11/1999
then clicks the show button to display the calender for the month of the year
Now my problem is once I get the String from the text field how can I differentiate between 11 and
1999.
-
March 3rd, 2000, 01:40 PM
#2
Re: TextField Please read this I have a Problem Please Help!!
-
March 3rd, 2000, 02:20 PM
#3
Re: TextField Please read this I have a Problem Please Help!!
Search for the '/' delimiter in the string
and take away the tokens on both sides of it.
Use StringTokenizer class.
Kannan
-
March 3rd, 2000, 03:53 PM
#4
Re: TextField Please read this I have a Problem Please Help!!
Use StringTokenizer to parse the String
String textFieldString = textField.getText();
StringTokenizer sToken = new StringTokenizer( textFieldString , "/" );
if( sToken.countTokens() == 2 ){
String strMonth = sToken.nextToken();
String strYear = sToken.nextToken();
}else{
// Show Error Message
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|