This commit is contained in:
2023-10-23 13:23:36 +02:00
parent 667dae6f1a
commit 322b22f9bf
5711 changed files with 72953 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,40 @@
import javax.swing.JComponent;
import java.awt.*;
import javax.swing.*;
public class Accueil extends JComponent {
private Image acc;
public Accueil() {
super();
this.acc = Toolkit.getDefaultToolkit().getImage("login.jpg");
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
if (this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.drawImage(this.acc,0,0,this);
}
public static void main(String[] args) {
JFrame fenetre = new JFrame();
Accueil imag = new Accueil();
JTextField champlog = new JTextField();
JTextField champmdp = new JTextField();
fenetre.setLayout(null);
fenetre.setSize(290,220);
fenetre.setLocation(0,0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
imag.setLocation(0,0);
imag.setSize(278,183);
champlog.setSize(160,20);
champlog.setLocation(102,92);
champmdp.setSize(160,20);
champmdp.setLocation(102,134);
fenetre.add(imag);
fenetre.add(champlog);
fenetre.add(champmdp);
fenetre.setVisible(true);
}
}

Binary file not shown.

View File

@@ -0,0 +1,21 @@
import javax.swing.*;
import java.awt.*;
public class AfficheImage extends JComponent {
private Image fond;
public AfficheImage(String cheminImage) {
super();
this.fond = Toolkit.getDefaultToolkit().getImage(cheminImage);
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
if (this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.drawImage(this.fond, 0, 0, this);
}
}

View File

@@ -0,0 +1,27 @@
import javax.swing.*;
import java.awt.*;
public class AfficheImage extends JComponent {
private Image fond;
public AfficheImage(String cheminImage) {
super();
this.fond = Toolkit.getDefaultToolkit().getImage(cheminImage);
}
@Override
public Dimension getPreferredSize() {
return new Dimension(288, 215);
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
if (this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
int x = (this.getWidth() - fond.getWidth(this)) / 2;
int y = (this.getHeight() - fond.getHeight(this)) / 2;
secondPinceau.drawImage(this.fond, x, y, this);
}
}

Binary file not shown.

View File

@@ -0,0 +1,28 @@
import javax.swing.*;
import java.awt.*;
public class Q3Main{
public static void main(String[] args) {
JFrame fenetre = new JFrame("Acceuil");
fenetre.setLocation(100, 100);
fenetre.setSize(288,223);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.setLayout(null);
AfficheImage fond = new AfficheImage("login.jpg");
fond.setSize(278,183);
fond.setLocation(0,5);
JTextField identifiant = new JTextField();
identifiant.setSize(150,29);
identifiant.setLocation(110,95);
JTextField motDePasse = new JTextField();
motDePasse.setSize(150,29);
motDePasse.setLocation(110,135);
fenetre.add(fond);
fenetre.add(identifiant);
fenetre.add(motDePasse);
fenetre.setVisible(true);
}
}

View File

@@ -0,0 +1,33 @@
import javax.swing.*;
import java.awt.*;
public class Q3Main{
public static void main(String[] args) {
JFrame fenetre = new JFrame("Acceuil");
fenetre.setLocation(100, 100);
fenetre.setSize(288,215);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
AfficheImage fond = new AfficheImage("login.jpg");
fond.setBounds(0, 0, 288, 215);
JTextField identifiant = new JTextField();
identifiant.setBounds(110, 105, 150, 30);
JTextField motDePasse = new JTextField();
motDePasse.setBounds(110, 145, 150, 30);
JPanel entrees = new JPanel();
entrees.setLayout(null);
entrees.setOpaque(false);
entrees.setBounds(0, 0, 288, 215);
entrees.add(identifiant);
entrees.add(motDePasse);
JPanel contenus = new JPanel(null);
contenus.add(fond);
contenus.add(entrees);
fenetre.setContentPane(contenus);
fenetre.setVisible(true);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB