Skip to content

Commit 7f7ffaf

Browse files
JongChernCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 770d3ac commit 7f7ffaf

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

ShimmerPCBasicExamples/src/main/java/com/shimmerresearch/simpleexamples/SensorMapsExample.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,18 @@ static void updateDeviceSpec() {
569569
if (textAreaDeviceSpec == null) {
570570
return;
571571
}
572-
ShimmerDevice device = btManager.getShimmerDeviceBtConnected(btComport);
573-
textAreaDeviceSpec.setText(buildDeviceSpecString(device));
574-
textAreaDeviceSpec.setCaretPosition(0);
572+
final ShimmerDevice device = btManager.getShimmerDeviceBtConnected(btComport);
573+
final String specString = buildDeviceSpecString(device);
574+
javax.swing.SwingUtilities.invokeLater(new Runnable() {
575+
@Override
576+
public void run() {
577+
if (textAreaDeviceSpec == null) {
578+
return;
579+
}
580+
textAreaDeviceSpec.setText(specString);
581+
textAreaDeviceSpec.setCaretPosition(0);
582+
}
583+
});
575584
}
576585

577586
@Override

0 commit comments

Comments
 (0)