@Override
            public void run() {

                try {
                    long startTime = System.currentTimeMillis();

                    Weights.calculateWeights(
                            weightsCalculatorWindow.getSpringLengthsPath(),
                            weightsCalculatorWindow.getAnglesPath(),
                            weightsCalculatorWindow.getOutputPath(),
                            weightsCalculatorWindow.getNumberOfOffsetSteps());

                    weightsCalculatorWindow.configureGuiForCalculationPhase(false);
                    JOptionPane.showMessageDialog(weightsCalculatorWindow, "Calculation complete. The opartion took " + getDuration(startTime), "Complete", JOptionPane.INFORMATION_MESSAGE);
                } catch (HeadlessException ex) {
                    JOptionPane.showMessageDialog(weightsCalculatorWindow, "An error occurred: " + ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }