I have created a scientific calculator program. What my program does is take \"label\" which is the string inputted by the user using buttons and evaluate the expression. What m
In stead of wrapping the call in a regular Thread
, make use of Swingutilities. You will need to do this since Swing isn't threadsafe. This way you will still be working on the EDT.
SwingUtilities.invokeLater(() -> {
try {
label2.setText(bracket(splitLabel(label.getText())));
} catch (Exception e) {
e.printStackTrace();
}
});