When I create my toolbar a dotted box appears around the first item, then if I select another item it will move to the last selected item.
does any1 know how to remove this behaviour!?
cheers
Printable View
When I create my toolbar a dotted box appears around the first item, then if I select another item it will move to the last selected item.
does any1 know how to remove this behaviour!?
cheers
Call (AbstractButton method) setFocusPainted(false) on the buttons.
What behaviour? This is normal.
The dotted box is there so the user knows which button has focus. This allows the user to tab from key to key and then use the keyboard to activate the button.
Good GUI design "does not" assume that all users use the mouse. In fact, for any application advanced users will use the keyboard instead of the mouse because its faster.
However, if you want to cripple your application by preventing users from using the keyboard, then you can use:
button.setFocusable(false);
thanks worked fine.
cheers
Good point. Users often demand keyboard short-cuts for everything.