update
This commit is contained in:
BIN
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Dessin.class
Normal file
BIN
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Dessin.class
Normal file
Binary file not shown.
31
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Dessin.java
Normal file
31
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Dessin.java
Normal file
@@ -0,0 +1,31 @@
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.*;
|
||||
|
||||
public class Dessin extends JComponent {
|
||||
|
||||
public Dessin(){
|
||||
}
|
||||
|
||||
@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.setColor(Color.BLUE);
|
||||
secondPinceau.drawRect(20,20, 50, 50);
|
||||
|
||||
secondPinceau.setColor(Color.GREEN);
|
||||
secondPinceau.fillOval(80, 20, 50, 50);
|
||||
|
||||
secondPinceau.setColor(Color.MAGENTA);
|
||||
Font myFont = new Font("Arial", Font.BOLD, 14);
|
||||
secondPinceau.setFont(myFont);
|
||||
secondPinceau.drawString(">o<",140, 20);
|
||||
|
||||
Image cercles = Toolkit.getDefaultToolkit().getImage("cercles.png");
|
||||
secondPinceau.drawImage(cercles,200,20,this);
|
||||
}
|
||||
}
|
||||
22
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Dessin.java~
Normal file
22
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Dessin.java~
Normal file
@@ -0,0 +1,22 @@
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
|
||||
public class Bonjour extends JComponent {
|
||||
@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.setColor(new Color.BLUE);
|
||||
secondPinceau.drawRect(20,20, 50, 50);
|
||||
|
||||
secondPinceau.setColor(new Color.GREEN);
|
||||
secondPinceau.fillOval(80, 20, 50, 50);
|
||||
|
||||
secondPinceau.setColor(new Color.BLACK);
|
||||
secondPinceau.drawString(140, 20, 50, 50)
|
||||
}
|
||||
}
|
||||
BIN
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Q1_Formes.class
Normal file
BIN
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Q1_Formes.class
Normal file
Binary file not shown.
16
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Q1_Formes.java
Normal file
16
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Q1_Formes.java
Normal file
@@ -0,0 +1,16 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Q1_Formes{
|
||||
public static void main(String[] args){
|
||||
JFrame fenetre = new JFrame();
|
||||
fenetre.setSize(500, 300);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
Dessin lesDessins = new Dessin();
|
||||
fenetre.add(lesDessins);
|
||||
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
19
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Q1_Formes.java~
Normal file
19
DEV/DEV2.1/TP06_Dessin/Q1_Formes/Q1_Formes.java~
Normal file
@@ -0,0 +1,19 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Q1_Formes{
|
||||
public static void main(String[] args){
|
||||
JFrame fenetre = new JFrame();
|
||||
fenetre.setSize(500, 300);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
fenetre.setVisible(true);
|
||||
|
||||
JPanel carre = new JPanel();
|
||||
JPanel disque = new JPanel();
|
||||
JPanel texte = new JPanel();
|
||||
}
|
||||
@Override
|
||||
protected void paintComponent(Graphics pinceau)
|
||||
}
|
||||
BIN
DEV/DEV2.1/TP06_Dessin/Q1_Formes/cercles.png
Normal file
BIN
DEV/DEV2.1/TP06_Dessin/Q1_Formes/cercles.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user