/** @version 1.22 2004-05-07 @author Cay Horstmann */ import java.awt.*; import java.awt.event.*; import java.applet.*; import java.util.*; import java.net.*; import javax.swing.*; public class Bookmark extends JApplet { public void init() { Box box = Box.createVerticalBox(); ButtonGroup group = new ButtonGroup(); int i = 1; String urlString; // read all link.n parameters 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++; } add(box); } }


linmou LV8
2023年3月19日
徐寿亮 LV1
2021年4月21日
高欢胜 LV1
2021年3月29日
2196316269 LV10
2021年2月24日
13043860zj LV16
2020年9月24日
xcj456 LV8
2020年9月12日
szy2503 LV2
2020年8月10日
16692039904 LV2
2020年6月25日
fighter919 LV1
2020年5月6日
hb2008 LV3
2020年4月25日