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 JEditorPaneCreate a Java program that retrieves and prints out a webpage using the GET method. Pass in the required URL via command line arguement.
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 JEditorPaneCreate a Java program that retrieves and prints out a webpage using the GET method. Pass in the required URL via command line arguement.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货