我尝试在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)