TP07
This commit is contained in:
BIN
APL2.1/TP07/Accueil/Accueil.class
Normal file
BIN
APL2.1/TP07/Accueil/Accueil.class
Normal file
Binary file not shown.
32
APL2.1/TP07/Accueil/Accueil.java
Normal file
32
APL2.1/TP07/Accueil/Accueil.java
Normal file
@@ -0,0 +1,32 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Accueil {
|
||||
public static void main(String[] args) {
|
||||
JFrame f = new JFrame("Accueil");
|
||||
f.setSize(285, 200);
|
||||
f.setLocation(100, 100);
|
||||
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
f.setLayout(null);
|
||||
|
||||
LoginScreen login = new LoginScreen();
|
||||
login.setLocation(0, 0);
|
||||
login.setSize(278, 183);
|
||||
f.add(login);
|
||||
|
||||
JTextField loginLabel = new JTextField();
|
||||
loginLabel.setBackground(new Color(0, 0, 0, 0));
|
||||
loginLabel.setLocation(100, 90);
|
||||
loginLabel.setSize(170, 30);
|
||||
f.add(loginLabel);
|
||||
|
||||
JTextField passLabel = new JTextField();
|
||||
passLabel.setBackground(new Color(0, 0, 0, 0));
|
||||
passLabel.setLocation(100, 130);
|
||||
passLabel.setSize(170, 30);
|
||||
f.add(passLabel);
|
||||
|
||||
f.setResizable(false);
|
||||
f.setVisible(true);
|
||||
}
|
||||
}
|
BIN
APL2.1/TP07/Accueil/LoginScreen.class
Normal file
BIN
APL2.1/TP07/Accueil/LoginScreen.class
Normal file
Binary file not shown.
22
APL2.1/TP07/Accueil/LoginScreen.java
Normal file
22
APL2.1/TP07/Accueil/LoginScreen.java
Normal file
@@ -0,0 +1,22 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class LoginScreen extends JComponent {
|
||||
private Image login;
|
||||
public LoginScreen() {
|
||||
super();
|
||||
this.login = Toolkit.getDefaultToolkit().getImage("login.jpg");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics brush) {
|
||||
Graphics newBrush = brush.create();
|
||||
|
||||
if (this.isOpaque()) {
|
||||
newBrush.setColor(this.getBackground());
|
||||
newBrush.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
}
|
||||
|
||||
newBrush.drawImage(this.login, 0, 0, this);
|
||||
}
|
||||
}
|
BIN
APL2.1/TP07/Accueil/login.jpg
Normal file
BIN
APL2.1/TP07/Accueil/login.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user