private void syncUI() { boolean started = mailService != null && mailService.isRunning(); pop3PortLabel.setText(POP3_PORT_LABEL_PREFIX + (started ? mailService.getPop3Port() : "")); smtpPortLabel.setText(SMTP_PORT_LABEL_PREFIX + (started ? mailService.getSmtpPort() : "")); startButton.setEnabled(!started); stopButton.setEnabled(started); testMessageButton.setEnabled(started); }