1. JFormattedTextField and Date coderanch.com |
2. Date Editor coderanch.comHi, My DateEditor returns a string; The first code block installs the editor and overrides it to return a string instead of a date. The problem is that it affects the String.class columns as well as the java.sql.Date columns. I can manage this by creating an editor for the string that uses a masks and does not include the "-" date ... |
3. Setting default date values in JFormattedTextFields forums.oracle.comtxtFrom = new JFormattedTextField(new SimpleDateFormat("dd/mm/yy")); //txtFrom.setValue(new Date(day,month,year)); //txtFrom.setValue(Calendar.getInstance()); txtFrom.setValue(new Date()); txtTo = new JFormattedTextField(new SimpleDateFormat("dd/mm/yy")); txtTo.setValue(new Date()); I have a couple of formatted text fields whoch I want to hold dates in. I want them initalised to the curent date when the program is launched but I keep getting values of 40 for the month. |