if(DishFormWeekNoWeek1Rb.hasFocus() == true){
DishFormWeekNoWeek1Rb.setSelected(hasFocus());
System.out.print(DishFormWeekNoWeek1Rb.getComponents().getClass().toString());
}
如何改进上面的代码,以便在单选按钮聚焦时它也会被选中?因为我正在使用标签转到下一个单选按钮,我想要的是当我选择并专注于单选按钮时,它也将被选中。鉴于意见和建议表示赞赏。
答案 0 :(得分:0)
if(DishFormWeekNoWeek1Rb.hasFocus() == true){
DishFormWeekNoWeek1Rb.setSelected(true);
DishFormWeekNoWeek1Rb.requestFocus(true);
System.out.print(DishFormWeekNoWeek1Rb.getComponents().getClass().toString());
}
@Andrew请对这个正在运行的评论发表评论也许你可以批评它是否有一个循环漏洞