程序问问:applet浏览指定URL
import java.net.*;import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.AppletContext;
import javax.swing.*;
import javax.swing.event.*;
public class ShowDocument extends JApplet{
public void init()
{
JButton goButton =new JButton("Link to www.sohu.com");
Container myContainer=getContentPane();
myContainer.add(new JLabel("Link to SOHU"),BorderLayout.NORTH);
myContainer.add(goButton,BorderLayout.SOUTH);
goButton.addActionListener(new ButtonListener());
}
class ButtonListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
try
{
URL newDocument=new URL("http://www.sohu.com");
AppletContext browser=getAppletContext();
browser.showDocument(newDocument);
}
catch(Exception URLException)
{}
}
}
}
这个程序的作用是什么?不是可以从链接打开搜狐网站吗?我点击Link to www.sohu.com链接是,怎么弹不出该网页呀?
----------------解决方案--------------------------------------------------------
帮帮忙吧,各位大虾.
----------------解决方案--------------------------------------------------------
...................服了
你这个APPLET又没有浏览器调用,怎么可能会显示页面啊
----------------解决方案--------------------------------------------------------