Terai Atsuhiro 2021-11-18 (木) 11:32:21

http://terai.xrea.jp/swing/textfieldmargin/screenshot.png

Insets m = (Insets) UIManager.get("TextField.margin");
InsetsUIResource iur = new InsetsUIResource(m.top,m.left+5,m.bottom,m.right);
UIManager.put("TextField.margin", iur);
Insets m = field01.getMargin();
Logger.global.info(m.toString());
Insets margin = new Insets(m.top,m.left+10,m.bottom,m.right);
field01.setMargin(margin);

Border b1 = BorderFactory.createEmptyBorder(0,20,0,0);
Border b2 = BorderFactory.createCompoundBorder(field02.getBorder(), b1);
field02.setBorder(b2);