Ajout d'une musique de fond dans le menu

This commit is contained in:
2024-04-07 17:14:17 +02:00
parent ff4be58baa
commit 9879dbee8c
8 changed files with 216 additions and 30 deletions

61
src/Button.java Normal file
View File

@@ -0,0 +1,61 @@
import javax.swing.*;
import java.awt.*;
/**
* Class containing custom settings for JButtons used in the application.
* @version 1.0
* @author Moncef STITI
* @author Marco ORFAO
*/
public class Button extends JButton {
/**
* Constructor
* @param text The text of the button
*/
public Button (String text) {
super(text);
setFont(new Font("Arial", Font.BOLD, 15));
setBackground(new Color(96, 175, 255));
}
/**
* Constructor
* @param text The text of the button
* @param dimension The dimension of the button
*/
public Button(String text, Dimension dimension) {
super(text);
setPreferredSize(dimension);
setFont(new Font("Arial", Font.BOLD, 20));
setBackground(new Color(96, 175, 255));
}
/**
* Constructor
* @param text The text of the button
* @param dimension The dimension of the button
* @param font The font of the text in the button
*/
public Button(String text, Dimension dimension, Font font) {
super(text);
setPreferredSize(dimension);
setFont(font);
setBackground(new Color(96, 175, 255));
}
/**
* Constructor
* @param text The text of the button
* @param dimension The dimension of the button
* @param font The font of the text in the button
* @param color The background color of the button
*/
public Button(String text, Dimension dimension, Font font, Color color) {
super(text);
setPreferredSize(dimension);
setFont(font);
setBackground(color);
}
}