Transférer les fichiers vers 'src/Test'

This commit is contained in:
2022-12-03 15:27:11 +01:00
parent fd6b0e8bad
commit 53481c883b
4 changed files with 117 additions and 44 deletions

View File

@@ -0,0 +1,33 @@
package Test;
import javax.swing.JButton;
import java.awt.*;
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;
public CustomJButton(String text, Color c) {
super(text);
this.setBackground(c);
init();
}
public CustomJButton(String text) {
super(text);
this.setBackground(defaultColor);
init();
}
private void init() {
this.setFont(font);
this.setFocusPainted(false);
//this.setContentAreaFilled(false);
this.setBorderPainted(false);
this.setBorder(new RoundedBorder(radius));
}
}