This commit is contained in:
Emmanuel Srivastava
2025-02-11 14:59:41 +01:00
parent 5b86f6f95b
commit d803766702
3 changed files with 34 additions and 2 deletions

View File

@@ -25,7 +25,10 @@ public class Formes extends JComponent {
secondPinceau.setColor(Color.GREEN);
secondPinceau.drawOval(140,10,25,25);
secondPinceau.fillOval(140,10,25,25);
secondPinceau.drawImage(this.img, 180,10, this);
}
}
}

View File

@@ -0,0 +1,14 @@
import javax.swing.*;
import java.awt.*;
public class MainSautoir {
public static void main(String[] args){
JFrame frame = new JFrame("Sautoir");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500,500);
frame.setLocation(500,250);
frame.setVisible(true);
}
}

View File

@@ -0,0 +1,15 @@
import javax.swing.*;
import java.awt.*;
public class Sautoir extends JComponent {
private Image img;
public Sautoir() {
super();
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
secondPinceau.setColor(this.getForeground());