Java focus question
This may be a silly question I don't know.
Is there a way to remove the highlighter to represent focus in a Java GUI?
For example when you cli开发者_Go百科ck on a button the text will have a slight rectangle around the text.
Thank you
I believe you want to remove the set focusable attribute from your items
using setFocusable(false)
http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html
That feature is there for a reason because it gives user feedback about which component currently has focus. But if you really must turn it off then you can use:
button.setFocusPainted( false );
As far as I knew one of the selling points of swing when it first appeared was that any GUI element could be completely customised. This might help you out: Custom Swing Controls
精彩评论