Answer the question
In order to leave comments, you need to log in
How to indent a button?
Hello everyone
Plz tell me how to indent the button?
similar to paddin? googled a lot of solutions like
setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
JBtn.setMargin(new Insets(5,5,10,10));
Answer the question
In order to leave comments, you need to log in
What you need is not an analogue of padding (this is just an internal margin), but an analogue of margin (external indents).
Here stackoverflow.com/questions/9565760/java-jpanel-with-margins-and-jtextarea-inside describes two options for implementing what you need with links to the Oracle documentation. You can easily google examples by name.
PS I will assume that you are familiar with css, maybe you should take a look at javaFX.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question