update
This commit is contained in:
@@ -17,7 +17,6 @@ public class MainSautoir {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
frame.setSize(500,500);
|
||||
frame.setLocation(500,250);
|
||||
|
26
DEV.2.1/TP/TP6-Dessin/3.Acceuil/Acceuil.java
Normal file
26
DEV.2.1/TP/TP6-Dessin/3.Acceuil/Acceuil.java
Normal file
@@ -0,0 +1,26 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Acceuil extends JComponent {
|
||||
private Image logo;
|
||||
|
||||
public Acceuil() {
|
||||
super();
|
||||
this.logo = Toolkit.getDefaultToolkit().getImage("img.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics pinceau) {
|
||||
Graphics secondPinceau = pinceau.create();
|
||||
secondPinceau.setColor(this.getForeground());
|
||||
|
||||
Font fonte = new Font("TimesRoman", Font.BOLD,24);
|
||||
secondPinceau.setColor(new Color(128,0,128));
|
||||
secondPinceau.setFont(fonte);
|
||||
secondPinceau.drawString("IUT", 10, 20);
|
||||
|
||||
secondPinceau.drawImage(this.logo, 20,30, this);
|
||||
|
||||
|
||||
}
|
||||
}
|
14
DEV.2.1/TP/TP6-Dessin/3.Acceuil/MainAcceuil.java
Normal file
14
DEV.2.1/TP/TP6-Dessin/3.Acceuil/MainAcceuil.java
Normal file
@@ -0,0 +1,14 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class MainAcceuil {
|
||||
public static void main(String[] args) {
|
||||
JFrame frame = new JFrame("Acceuil");
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setUndecorated(true); //https://waytolearnx.com/2020/05/changer-la-bordure-dune-jframe-java.html
|
||||
|
||||
frame.setSize(278,183);
|
||||
frame.setLocation(500,250);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user