1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| // Opens a port.
if (cmd.equals("Open Port")) {
openButton.setEnabled(false);
Cursor previousCursor = getCursor();
setNewCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
configurationPanel.setParameters();
try {
connection.openConnection();
} catch (SerialConnectionException e2) {
AlertDialog ad = new AlertDialog(this,
"Error Opening Port!",
"Error opening port,",
e2.getMessage() + ".",
"Select new settings, try again.");
openButton.setEnabled(true);
setNewCursor(previousCursor);
return;
}
portOpened();
setNewCursor(previousCursor);
} |
Partager