displayMessage("Please select at least one transport or uncheck \"Preferred Transports\"");
return;
}
// Get rid of the "none" elements
final IntVector transportIdsVector = new IntVector();
if (_order1.getSelectedIndex() != 0) {
transportIdsVector.addElement(_order1.getSelectedIndex());
}
if (_order2.getSelectedIndex() != 0) {
transportIdsVector.addElement(_order2.getSelectedIndex());
}
if (_order3.getSelectedIndex() != 0) {
transportIdsVector.addElement(_order3.getSelectedIndex());
}
if (_order4.getSelectedIndex() != 0) {
transportIdsVector.addElement(_order4.getSelectedIndex());
}
if (_order5.getSelectedIndex() != 0) {
transportIdsVector.addElement(_order5.getSelectedIndex());
}
if (_order6.getSelectedIndex() != 0) {
transportIdsVector.addElement(_order6.getSelectedIndex());
}
transportIdsVector.trimToSize();
preferredTransports = transportIdsVector.getArray();
}
// Process disallowed transports
final IntVector disallowedTransports = new IntVector();
if (_disallowDirectTCP.getChecked()) {
disallowedTransports
.addElement(TransportInfo.TRANSPORT_TCP_CELLULAR);
}
if (_disallowWap.getChecked()) {
disallowedTransports.addElement(TransportInfo.TRANSPORT_WAP);
}
if (_disallowWap2.getChecked()) {
disallowedTransports.addElement(TransportInfo.TRANSPORT_WAP2);
}
if (_disallowMds.getChecked()) {
disallowedTransports.addElement(TransportInfo.TRANSPORT_MDS);
}
if (_disallowBisB.getChecked()) {
disallowedTransports.addElement(TransportInfo.TRANSPORT_BIS_B);
}
if (_disallowWifi.getChecked()) {
disallowedTransports.addElement(TransportInfo.TRANSPORT_TCP_WIFI);
}
// Trim excess
disallowedTransports.trimToSize();
// Configure the factory if needed
if (disallowedTransports.size() > 0) {
factory.setDisallowedTransportTypes(disallowedTransports.getArray());
}
// Get the connection
Status.show("Attempting Connection...", 500);
final Thread t =