开发者

JRemove default selection in JButton

JRemove default selection in JButton

Hi , I am creating a box which has few buttons in it. When I am executing it a weired recatangualr box is coming which denotes it's default selection. I want to remove it.Can some one please help me. Below is the snapshot of my code:

    JPanel buttons = new JPane开发者_如何学运维l();
     buttons.add(Box.createHorizontalGlue()); 
buttons.add(NCDEX);  
  buttons.add(Box.createHorizontalGlue()); buttons.add(MCX);

Attached screenshot for reference.I want to remvoe the recatngular box surrounding the button named NCDEX


I believe that the rectangle is present when the button has focus. One possible solution is to call setFocusable(false) on all JButtons that you don't want to have this occur on.


Did you try JButton.setDefaultCapable()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜