URL doesn't exist in Codename One since networking is too different on other platforms (Windows Phone is really extremely different but iOS is also pretty hairy).
You can use something like:
ConnectionRequest r = new ConnectionRequest();
r.setUrl(imageURL);
r.setPost(false);
NetworkManager.getInstance().addToQueueAndWait(r);
EncodedImage.create(r.getResultData());
But you would be better off using ImageDownloadService which will do far more including binding to the UI, caching, resizing etc...
Unlike in the code you typed this will do everything in a background thread, handle all exceptions and properly cleanup all streams.