question: private boolean checkPortNames ( ) { for ( JmrixConfigPane configPane : JmrixConfigPane . getListOfConfigPanes ( ) ) { String port = configPane . getCurrentProtocolInfo ( ) ; if ( port . equals ( JmrixConfigPane . NONE_SELECTED ) || port . equals ( JmrixConfigPane . NO_PORTS_FOUND ) ) { if ( JOptionPane . showConfirmDialog ( null , MessageFormat . format ( rb . getString ( "MessageSerialPortWarning" ) , new Object [ ] { port , configPane . getCurrentProtocolName ( ) } ) , rb . getString ( "MessageSerialPortNotValid" ) , JOptionPane . YES_NO_OPTION , JOptionPane . ERROR_MESSAGE ) != JOptionPane . YES_OPTION ) { return false ; } } } return true ; }
target:  Checks to see if user selected a valid serial port