关于applet 的问题?

fengyunxian 2004-11-21 04:07:28
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.net.*;
import java.util.*;

public class BookMark extends JApplet{
public void init(){
Box box = Box.createVerticalBox();
ButtonGroup group = new ButtonGroup();

int i = 1;
String urlString;

// read all the link paramaters
while((urlString = getParameter("link." + i))!= null){
try{
final URL url = new URL(urlString);

// make a radio button for each link
JRadioButton button = new JRadioButton(urlString);
box.add(button);
group.add(button);

// selecting the radio button shows the url in the "right" frame
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
AppletContext context = getAppletContext();
context.showDocument(url, "right");
}
});
}
catch(MalformedURLException e){
e.printStackTrace();
}

i++;
}

Container contentPane = getContentPane();
contentPane.add(box);
}
}

/**
<applet code="BookMark.class" width="290" height="300">
<param name="link.1" value="http://java.sun.com"/>
<param neme="link.2" value="http://163.com"/>
<param neme="link.3" value="http://263.com"/>
<param neme="link.4" value="http://www.eyou.com"/>
<param neme="link.5" value="http://www.xici.net"/>
<param neme="link.6" value="http://csdn.net"/>
<param neme="link.7" value="http://www.netscape.com"/>
</applet>
*/
appletviewer BookMark.java时出现问题
警告:<param name... value...>标记需要名称属性。
我搞了半天也没搞懂,那位仁兄帮忙解决一下。
...全文
178 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
fengyunxian 2004-11-21
  • 打赏
  • 举报
回复
太粗心了呀。
dxj1234 2004-11-21
  • 打赏
  • 举报
回复
我最害怕动不动就贴大段代码的,眼都花了
PoemCode 2004-11-21
  • 打赏
  • 举报
回复
二楼看得好认真,我刚开始也没看出来
csforgood 2004-11-21
  • 打赏
  • 举报
回复
楼主粗心了吧
我改过后试过了 very good
febchen 2004-11-21
  • 打赏
  • 举报
回复
neme??

name把
只有第一个对的
fengyunxian 2004-11-21
  • 打赏
  • 举报
回复
自己顶一下

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧