-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per component focus border #412
Comments
You can disable focus border for single scroll pane: Component view = myScrollPane.getViewport().getView();
((JComponent)view).putClientProperty(
FlatClientProperties.COMPONENT_FOCUS_OWNER,
(Predicate<JComponent>) c -> false ); |
Thank you for the tip, I guess making the scroll pane non focusable would work too, but I was looking for something more like a |
There is actually a simple solution. Create a own border class that changes the color: public class MyScrollPaneBorder extends FlatBorder {
public MyScrollPaneBorder() {
focusedBorderColor = Color.red;
}
} And install it: MyScrollPaneBorder myScrollPaneBorder = new MyScrollPaneBorder();
UIManager.put( "ScrollPane.border", myScrollPaneBorder );
UIManager.put( "Table.scrollPaneBorder", myScrollPaneBorder ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The focus border configured with
Component.focusedBorderColor
is applied to all components. It would be nice to be able to disable it for some components such as the JScrollPanes.The text was updated successfully, but these errors were encountered: