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()
精彩评论