怎么没看到分呀!
抢分!!!!

解决方案 »

  1.   

    不是吧
    就60分还有人抢啊
    哪有天理了
    555555555
      

  2.   

    不知道这段代码和你的想法是否一样
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;public class TUEditorPane extends JFrame implements ActionListener {
        JEditorPane edit;
        JTextField text;
        URL page;    public TUEditorPane() {
            super("fds");
            setSize(500, 400);
            Container c = getContentPane();
            JButton b = new JButton("link");
            JLabel lbel1 = new JLabel("UrlAddress:");
            JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));        p.add(lbel1);
            text = new JTextField(32);
            text.addActionListener(this);
            b.addActionListener(this);
            p.add(text);
            p.add(b);
            c.add(p, BorderLayout.NORTH);
            edit = new JEditorPane();
            JScrollPane js = new JScrollPane(edit);
            edit.addHyperlinkListener(new HyperlinkListener() {
                public void hyperlinkUpdate(HyperlinkEvent eh) {
                    try {
                        edit.setPage(eh.getURL());                } catch (Exception ej) {
                    }
                }
            });
            c.add(js, BorderLayout.CENTER);        addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent ew) {
                    System.exit(0);
                }
            });
        }    public void actionPerformed(ActionEvent e) {
            try {
                page = new URL(text.getText());
            } catch (java.io.IOException eio) {
                System.out.println(eio);
            }
            try {
                edit.setPage(page);
            } catch (Exception ei) {
                System.out.println(e);
            }
        }    public static void main(String args[]) {
            TUEditorPane t = new TUEditorPane();
            t.show();
        }}