报告可以简化的 java.awt.InsetsJBUI.insetsXyz() 的用法。

Insets 实例非 DPI 感知,并且可能导致 UI 布局问题。

快速修复会使用 JBUI.insets() 执行替换或简化表达式。

示例:


// 错误:
Insets insets1 = new Insets(1, 2, 3, 4);
Insets insets2 = new Insets(1, 2, 1, 2);
Insets insets3 = new Insets(1, 0, 0, 0);

// 正确:
Insets insets1 = JBUI.insets(1, 2, 3, 4);
Insets insets2 = JBUI.insets(1, 2);
Insets insets3 = JBUI.insetsTop(1);