一道很好的java练习题
Use the following as a hint:
public class Strathzilla extends JFrame {
public Strathzilla(String urlAsString) throws Exception {
JEditorPane htmlRenderer = new JEditorPane();
getContentPane().add(htmlRenderer);
setVisible(true);
setSize(300,200);
htmlRenderer.setContentType("text/html"); // retrieve page htmlRenderer.setText(page); // rest of your code
}
要求:
Convert the GET web page retrieval code into a mini web browser by instead of printing out the retrived html, injecting it into a JEditorPane
Create a Java program that retrieves and prints out a webpage using the GET method. Pass in the required URL via command line arguement.