How can I add padding to a jtextfield

后端 未结 6 1695
予麋鹿
予麋鹿 2021-01-01 12:08

How can I add some padding to a jtextfield? I\'ve tried tf.setMargin(new Insets(5,5,5,5)); which doesn\'t have any effect.

6条回答
  •  -上瘾入骨i
    2021-01-01 12:33

    you have look at CompoundBorder, there you can set LineBorder(Color.gray, 1) and with

    EmptyBorder(5, 5, 5, 5)
    

提交回复
热议问题