Commit fa0187b2 authored by Baptiste Fournier's avatar Baptiste Fournier

added MonDessin class

parent 671500e6
No preview for this file type
import javax.swing.*;
import java.awt.*;
public class MonDessin extends JPanel {
public MonDessin() {
// TODO Auto-generated constructor stub
}
public MonDessin(LayoutManager layout) {
super(layout);
// TODO Auto-generated constructor stub
}
public MonDessin(boolean isDoubleBuffered) {
super(isDoubleBuffered);
// TODO Auto-generated constructor stub
}
public MonDessin(LayoutManager layout, boolean isDoubleBuffered) {
super(layout, isDoubleBuffered);
// TODO Auto-generated constructor stub
}
public void paint(Graphics g){
g.setColor(Color.blue);
g.fillRect(20, 10, 40, 30);
}
}
...@@ -13,7 +13,8 @@ public class TestSwing { ...@@ -13,7 +13,8 @@ public class TestSwing {
MainFrame.setPreferredSize(preferredSize); MainFrame.setPreferredSize(preferredSize);
MainFrame.setTitle("Graphisme avec Swing"); MainFrame.setTitle("Graphisme avec Swing");
MainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
MainFrame.pack();
MainFrame.setVisible(true);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment