小编Mon*_*ffy的帖子

如何使用超链接创建一个复选框

题 :

我尝试在Java中创建一个包含超链接的复选框.

但是,我无法使链接可点击,只能链接,而不是整个文本.

在此输入图像描述

这是我的示例代码:

public class TestClickLinkInCheckBox implements MouseListener {

    private JFrame frame1;
    private JFrame frame2;
    private String linkedText = "I have checked the data set I have selected, and agree to sign it following <a href=\"http://www.google.com\">the conditions of use of the service, defined in the policies of signature and certification</a> that I attest having read.";
    private JLabel label;

    public TestClickLinkInCheckBox() {
        justCheckBox();
        checkBoxWithLabel();
    }

    private void justCheckBox() throws HeadlessException {
        frame1 = new JFrame();
        JPanel panel = new …
Run Code Online (Sandbox Code Playgroud)

java checkbox swing jtextpane hyperlink

5
推荐指数
1
解决办法
598
查看次数

标签 统计

checkbox ×1

hyperlink ×1

java ×1

jtextpane ×1

swing ×1