I have a formatting question for my Java swing application. It should be fairly straightforward, but I am having difficulty finding any aid (Every topic seems to be regardin
I will suppose your JPanel contains JTextField, for the sake of the demo.
Those components provides JTextComponent#setMargin() method which seems to be what you're looking for.
If you're looking for an empty border of any size around your text, well, use EmptyBorder