super("ProgressMonitorDemo");
task = new LongTask();
//Create the demo's UI.
startButton = new JButton("Start");
startButton.setActionCommand("start");
startButton.addActionListener(new ButtonListener());
taskOutput = new JTextArea(5, 20);
taskOutput.setMargin(new Insets(5,5,5,5));
taskOutput.setEditable(false);
JPanel contentPane = new JPanel();
contentPane.setLayout(new BorderLayout());
contentPane.add(startButton, BorderLayout.NORTH);
contentPane.add(new JScrollPane(taskOutput), BorderLayout.CENTER);
contentPane.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
setContentPane(contentPane);
//Create a timer.
timer = new Timer(ONE_SECOND, new TimerListener());