if (SwingUtilities.isEventDispatchThread()) {
can_cancel = false;
System.out.printf("Uh-oh, reading serial device from swing thread\n");
}
flush_output();
if (remote && can_cancel) {
if (SwingUtilities.isEventDispatchThread()) {
can_cancel = false;
System.out.printf("Uh-oh, reading serial device from swing thread\n");
}
flush_output();
if (remote && can_cancel) {