If you want the user to choose the layer to load, you can programmatically show the Lucy selection UI. This is the dialog box that also appears when a Lucy user drags-and-drops a server URL on the map.
public void connectToWMSServer(ILcyLucyEnv aLucyEnv, ILcyGenericMapComponent<?, ?> aMapComponent) throws IOException {
String serverName = "https://sampleservices.luciad.com/wms";
//Present the WMS UI to the user
//This is the equivalent of drag-and-dropping the URL on the map.
//Note that this should be called on a background thread to avoid blocking the UI
TLcyDataFormatManager dataFormatManager = aLucyEnv.getDataFormatManager();
dataFormatManager.handleDataSources(new String[]{serverName},
aMapComponent,
null,
aMapComponent.getComponent());
}