Ajouts d'une version BETA du menu principal qui respecte le modèle MVC et la responsabilité unique + Modifications du README.md
This commit is contained in:
27
TestV2/src/fr/monkhanny/dorfromantik/components/Title.java
Normal file
27
TestV2/src/fr/monkhanny/dorfromantik/components/Title.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package fr.monkhanny.dorfromantik.components;
|
||||
|
||||
import fr.monkhanny.dorfromantik.utils.FontManager;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Title extends JLabel {
|
||||
|
||||
public Title(String text, float fontSize) {
|
||||
super(text, SwingConstants.CENTER);
|
||||
setFont(FontManager.getTitleFont(fontSize));
|
||||
setForeground(Color.WHITE);
|
||||
setBorder(BorderFactory.createEmptyBorder(20, 0, 20, 0));
|
||||
}
|
||||
|
||||
public Title(String text, float fontSize, Color textColor) {
|
||||
super(text, SwingConstants.CENTER);
|
||||
setFont(FontManager.getTitleFont(fontSize));
|
||||
setForeground(textColor);
|
||||
setBorder(BorderFactory.createEmptyBorder(20, 0, 20, 0));
|
||||
}
|
||||
|
||||
public void updateTitleFont(float fontSize) {
|
||||
setFont(FontManager.getTitleFont(fontSize));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user