-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
UI artefact at bottom right corner of scrollpane #35
Comments
Is this from a HiDPI screen? |
I wish I had a HiDPI screen! 😄 |
The artefact is the inner focus that gets painted in the scroll pane (0.5 is the default in the above). It is only visible in the bottom right corner because the other sides get painted over by the view and the 2 scroll bars. If you try with a bigger inner focus width: public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(new FlatLightLaf());
UIManager.getDefaults().put("Component.innerFocusWidth", 2);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel centerPane = new JPanel(new BorderLayout());
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JScrollPane scrollPane = new JScrollPane(new JTextArea(50, 80) {
@Override
public boolean hasFocus() {
return true;
}
});
centerPane.add(scrollPane);
frame.getContentPane().add(centerPane);
frame.setSize(400, 300);
frame.setVisible(true);
} I think scroll panes should not paint the inner focus. |
…f both scroll bars are visible, which was caused by `Component.innerFocusWidth` > 0 (issue #35)
Many thanks. The fix is now in master branch. |
Thanks a lot, it works as advertised! 🙂 |
Hi,
I noticed a visual glitch when a component in a scrollpane is focused: the bottom corner at the intersection of the 2 scroll bars has an additional edge. Note that it is more or less visible depending on the theme you are using.
Here is a screenshot:

The text was updated successfully, but these errors were encountered: