Ajout des travaux effectuer
This commit is contained in:
31
23DEV1.1/TPS2/TP01/Dessin/Formes/Formes.java
Normal file
31
23DEV1.1/TPS2/TP01/Dessin/Formes/Formes.java
Normal file
@@ -0,0 +1,31 @@
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.*;
|
||||
|
||||
public class Formes
|
||||
{
|
||||
private Image trucChelou;
|
||||
public void paintComponent(Graphics g)
|
||||
{
|
||||
Graphics secondPinceau = g.create();
|
||||
if(isOpaque())
|
||||
{
|
||||
secondPinceau.setColor(getBackground());
|
||||
secondPinceau.drawRect(0, 0, getWidth(), getHeight());
|
||||
}
|
||||
secondPinceau.setColor(color.BLUE);
|
||||
fillRect(10, 10, 50, 50);
|
||||
secondPinceau.setColor(color.GREEN);
|
||||
drawOval(30,30, 25, 25);
|
||||
secondPinceau.setColor(color.MAGENTA);
|
||||
secondPinceau.drawString(">o<",getWidth()/2 - 30, getHeight()/2);
|
||||
secondPinceau.("cercles.png", );
|
||||
}
|
||||
public static void main(String[] args)
|
||||
{
|
||||
JFrame frame = new JFrame("Frame");
|
||||
frame.setSize(400, 400);
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Dessin/Formes/cercles.png
Normal file
BIN
23DEV1.1/TPS2/TP01/Dessin/Formes/cercles.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user