An application I am writing consists, among others, a JButton and a JTextArea. A click on the button leads to a long calculation, resulting in a text shown in the JTextArea.
you may also want to display some sort of spinning gif or "progress bar" to show that the answer is being calculated; feedback to the user is good.
(once you are using a swingworker, then the gui won't freeze and the gui can do its own thing while the calculation is taking place)