Inspectopedia
 
2024.3

Use DPI-aware borders

Warning
Performance
New
Last modified: 03 December 2024

Reports usages of javax.swing.border.EmptyBorder and JBUI.Borders.emptyXyz() that can be simplified.

The EmptyBorder instances are not DPI-aware and can result in UI layout problems.

Quick fix performs replacement with JBUI.Borders.empty() or simplifies the expression.

Example: