JButton avec marge interne et bordure
Bonjour à tous,
j'aimerai appliquer une marge interne à mon bouton.
J'ai essayé ceci :
Code:
1 2
| btnRechercher.setBorder(UIManager.getBorder("DesktopIcon.border"));
btnFind.setMargin(new Insets(1,50,1,1)); |
sans succès.
J'ai vu dans l'API de l'AbstractButton ceci :
"Sets space for margin between the button's border and the label. Setting to null will cause the button to use the default margin. The button's default Border object will use this value to create the proper margin. However, if a non-default border is set on the button, it is that Border object's responsibility to create the appropriate margin space (else this property will effectively be ignored)."
Je n'arrive cependant pas à appliquer une marge interne en passant par mon objet Border comme il est indiqué.
Qulequ'un sait-il comment faire pour appliquer une marge interne sur un bouton ayant une bordure appliquée?
Merci d'avance