int right = paddingRight == null ? 3 : Math.max(3, paddingRight.intValue());
//if a border is set or a background color is set, then use a special JButton with the BasicButtonUI.
if (disableOSBorder) {
//when background color is set, need to use the BasicButtonUI, certainly when using XP l&f
BasicTextUI ui = new BasicTextFieldUI();
field.setUI(ui);
Border fieldBorder = BorderFactory.createEmptyBorder(top, left, bottom, right);
field.setBorder(fieldBorder);
}
else {