I tried using multiple listeners to see if something got fired when the PC screen was unlocked but to no avail.
SwingUtilities.invokeLater(() -> {
elapsedTimeTextField.setText(actualTimeTakenTask);
panel.repaint(); // this was added and it fixed the problem
});
I have the above code as part of a Timer instance that updates the textfield with elapsed time every second.
The magic solution was to include the panel.repaint() line and that stopped the problem.
Not sure why this fixed it but glad I stumbled upon it!!
--- Update ---
I tried using multiple listeners to see if something got fired when the PC screen was unlocked but to no avail.
SwingUtilities.invokeLater(() -> {
elapsedTimeTextField.setText(actualTimeTakenTask);
panel.repaint(); // this was added and it fixed the problem
});
I have the above code as part of a Timer instance that updates the textfield with elapsed time every second.
The magic solution was to include the panel.repaint() line and that stopped the problem.
Not sure why this fixed it but glad I stumbled upon it!![/QUOTE]