Results 1 to 4 of 4
Thread: Date Inputs
- 11-05-2007, 08:25 AM #1
Member
- Join Date
- Jun 2007
- Location
- Colombo, Sri Lanka
- Posts
- 32
- Rep Power
- 0
Date Inputs
Hi,
I want the user to enter a date value. What is the Java way of doing this? In .NET they have an object called DateTimePicker for this purpose. Is there a similar object in Swing?
Regards,
Hiranya
- 11-05-2007, 09:07 AM #2
Is there a similar object in Swing?
Not as far as I know as of j2se 1.5
There may be some private or public apps that do this.
You can make up something that will do this for you. It is difficult to have a user enter a date string in a textField and then try to parse it. You can provide components such as JSpinners for the user to select a day, month and year from. This way you can control how the data is handled and eliminate parsing miseries. Just depends on what you want to do.
- 11-06-2007, 10:24 AM #3
Member
- Join Date
- Jun 2007
- Location
- Colombo, Sri Lanka
- Posts
- 32
- Rep Power
- 0
I'm not very familiar with JSpinners. Could you give some more information on JSpinners. How do we specify the range of values in a JSpinner? Can we use JSpinners with Strings?
Regards,
Hiranya
- 11-06-2007, 06:11 PM #4
Could you give some more information on JSpinners.
How to Use Spinners
How do we specify the range of values in a JSpinner?
This is done via the SpinnerModel for each spinner - see JSpinner api.
Can we use JSpinners with Strings?
Yes, with a SpinnerListModel.
Similar Threads
-
java.util.Date vs java.sql.Date
By Jack in forum New To JavaReplies: 5Last Post: 10-28-2010, 03:59 PM -
Difference between current date and anothe date
By vijay balusamy in forum New To JavaReplies: 1Last Post: 04-16-2008, 05:15 PM -
Java program that stores user inputs
By staticy2003 in forum Advanced JavaReplies: 6Last Post: 01-24-2008, 08:46 PM -
Calendar.DATE
By mew in forum New To JavaReplies: 1Last Post: 01-04-2008, 08:51 PM -
Date comparison
By Rageagainst20 in forum New To JavaReplies: 0Last Post: 12-19-2007, 07:34 PM
Bookmarks