import java.io.IOException; import java.net.URL; import java.util.Scanner; import javax.swing.JOptionPane; /** * * @author Bill Kraynek * * COP3337 Example */ public class RemoteFileReadExample { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { String fileAddress = "http://www.cis.fiu.edu/~kraynek/COP3337-examples/ArrayListMaxExample.java"; URL url = new URL(fileAddress); Scanner fileScanner = new Scanner(url.openStream()); String out = ""; while( fileScanner.hasNext() ) { out += fileScanner.nextLine() + "\n"; }// end while JOptionPane.showMessageDialog(null,out); } }