Let's suppose we have a JFrame called FrmRegistration. Its function is inserting data into a table called records.
MySQL's command desc records would result the following:
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| id | varchar(7) | NO | PRI | | |
| name | varchar(100) | NO | | NULL | |
| birthday | date | NO | | NULL | |
+-----------+--------------+------+-----+---------+-------+
Within FrmRegistration there's a JFormattedTextField for birthday input we'll call ftfBirthday. In Netbeans, we put names into components by right-clicking it and going to Properties -> Code tab -> Variable name. Or right-click -> Customize code -> Rename... button.
Right-click the field and go to Properties, then in FormatterFactory, click the "..." button. Create a customized field with: ####/##/##
The reason for a JFormattedTextField is that the user wouldn't lose time by typing the slashes. They appear automatically.
What should be done in the source-code of a button in FrmRegistration called Insert?