Mise à jour de 'src/Test/CustomJButton.java'

This commit is contained in:
Romain BESSON 2022-12-04 23:22:28 +01:00
parent c9fb5669f0
commit 848b195beb

View File

@ -3,19 +3,28 @@ package Test;
import javax.swing.JButton;
import java.awt.*;
/**
* Bouton personnalisé avec des bords arrondis et un fond transparent
*/
public class CustomJButton extends JButton {
private final Font font = new Font("Arial", Font.PLAIN, 15);
private final Color defaultColor = Color.GRAY;
private final int radius = 20;
/**
* Un constructeur avec une couleur personnalisée
* @param text texte affiché dans le bouton
* @param c couleur du bouton
*/
public CustomJButton(String text, Color c) {
super(text);
this.setBackground(c);
init();
}
/**
* @param text texte affiché dans le bouton
*/
public CustomJButton(String text) {
super(text);
this.setBackground(defaultColor);