1个回答
展开全部
1、取消设置Jbutton的Icon
12
JButton jbtn = new JButton("登录",<a href="https://www.baidu.com/s?wd=icon&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9uyubPjTznADvPWNbnWIb0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EPHRLPW0LnWT3" target="_blank" class="baidu-highlight">icon</a>); // 改为JButton jbtn = new JButton("登录");
2、取消布局方式,直接设置button的bounds
1234
Button.setBounds(x,y,width,height);Container c = this.getContentPane();c.setLayout(null);c.add(Button);
12
JButton jbtn = new JButton("登录",<a href="https://www.baidu.com/s?wd=icon&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9uyubPjTznADvPWNbnWIb0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EPHRLPW0LnWT3" target="_blank" class="baidu-highlight">icon</a>); // 改为JButton jbtn = new JButton("登录");
2、取消布局方式,直接设置button的bounds
1234
Button.setBounds(x,y,width,height);Container c = this.getContentPane();c.setLayout(null);c.add(Button);
追问
不是swing是fx
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询