public class DivideByZeroTest extends JFrame implements ActionListener
{
private JTextField inputField1,inputField2,outputField;
private int number1,number2,result;
public DivideByZeroTest()
{
super("Demonstrating Exceptions");
JFormattedTextField extends JTextField adding support for formatting arbitrary values, as well as retrieving a particular object once the user has edited the text. The following illustrates configuring a JFormattedTextField to edit dates:
JFormattedTextField ftf = new JFormattedTextField();
ftf.setValue(new Date());
Once a JFormattedTextField has been created, you can listen for editing changes by way of adding a PropertyChangeListener and listening for PropertyChangeEvents with the property name value.